Skip to content

Commit

Permalink
fix: Add timeout for bastion and bootstrap VM creation (#111)
Browse files Browse the repository at this point in the history
Creation of bastion or bootstrap VM's sometimes hang forever. This patch
set a timeout of 5 min for VM creation.

Signed-off-by: Klaus Smolin <smolin@de.ibm.com>
Co-authored-by: Jacob Emery <jacob.emery@ibm.com>
  • Loading branch information
smolin-de and jacobemery committed Apr 10, 2023
1 parent 35fca2d commit ddeb373
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 14 additions & 2 deletions roles/create_bastion/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,20 @@
--location {{ env.file_server.protocol }}://{{ env.file_server.user + ':' + env.file_server.pass + '@' if env.file_server.protocol == 'ftp' else '' }}{{ env.file_server.ip }}/{{ env.file_server.iso_mount_dir }} \
--disk pool={{ env.cluster.networking.metadata_name }}-vdisk,size={{ env.bastion.resources.disk_size }} \
--network network={{ env.bridge_name }} \
--graphics=none \
--graphics none \
--noautoconsole --wait=-1 \
--initrd-inject "/{{ kvm_host_home.stdout }}/{{ env.file_server.cfgs_dir }}/{{ env.bastion.networking.hostname }}/bastion-ks.cfg" \
--extra-args "inst.ks=file:/bastion-ks.cfg ip={{ env.bastion.networking.ip }}::{{ env.bastion.networking.gateway }}\
:{{ env.bastion.networking.subnetmask }}:{{ env.bastion.networking.hostname }}:enc1:none console=ttysclp0"
:{{ env.bastion.networking.subnetmask }}:{{ env.bastion.networking.hostname }}::none console=ttysclp0"
timeout: 300
register: cmd_output

- name: Debug, print above command output
tags: create_bastion, virt-install
ansible.builtin.debug:
var: cmd_output

- name: Waiting 1 minute for automated bastion installation and configuration to complete
tags: create_bastion, virt-install
ansible.builtin.pause:
minutes: 1
3 changes: 2 additions & 1 deletion roles/create_bootstrap/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
coreos.inst.ignition_url=http://{{ env.bastion.networking.ip }}:8080/ignition/bootstrap.ign" \
--graphics none \
--wait=-1 \
--noautoconsole
--noautoconsole
timeout: 300

0 comments on commit ddeb373

Please sign in to comment.