diff --git a/roles/copr/backend/tasks/resalloc.yml b/roles/copr/backend/tasks/resalloc.yml index edad112ca4..3eeaaf00da 100644 --- a/roles/copr/backend/tasks/resalloc.yml +++ b/roles/copr/backend/tasks/resalloc.yml @@ -60,6 +60,7 @@ - vm-aarch64-new - vm-aws-new - vm-aws-delete + - vm-aws-check tags: - provision_config diff --git a/roles/copr/backend/templates/resalloc/pools.yaml b/roles/copr/backend/templates/resalloc/pools.yaml index 22f7db65e4..66a1d28412 100644 --- a/roles/copr/backend/templates/resalloc/pools.yaml +++ b/roles/copr/backend/templates/resalloc/pools.yaml @@ -42,6 +42,8 @@ aws_x86_64_normal: - arch_armhfp_emulated cmd_new: "/var/lib/resallocserver/resalloc_provision/vm-aws-new --arch=x86_64" cmd_delete: "/var/lib/resallocserver/resalloc_provision/vm-aws-delete" + cmd_livecheck: "/var/lib/resallocserver/resalloc_provision/vm-aws-check" + livecheck_period: 180 reuse_opportunity_time: 180 reuse_max_count: 8 reuse_max_time: 1800 @@ -56,6 +58,8 @@ aws_aarch64_normal: - arch_aarch64_native cmd_new: "/var/lib/resallocserver/resalloc_provision/vm-aws-new --arch=aarch64" cmd_delete: "/var/lib/resallocserver/resalloc_provision/vm-aws-delete" + cmd_livecheck: "/var/lib/resallocserver/resalloc_provision/vm-aws-check" + livecheck_period: 180 reuse_opportunity_time: 180 reuse_max_count: 8 reuse_max_time: 1800 diff --git a/roles/copr/backend/templates/resalloc/vm-aws-check b/roles/copr/backend/templates/resalloc/vm-aws-check new file mode 100755 index 0000000000..3c450f89ce --- /dev/null +++ b/roles/copr/backend/templates/resalloc/vm-aws-check @@ -0,0 +1,13 @@ +#! /bin/sh + +die() { echo "$*" >&2 ; exit 1; } + +set -x +set -e +test -n "$RESALLOC_NAME" +test -n "$RESALLOC_RESOURCE_DATA" + +# we only put IP out in spawning script, nothing else +set -- $(echo "$RESALLOC_RESOURCE_DATA" | base64 --decode) +IP=$1 +ssh "root@$IP" true