Created
April 7, 2017 14:13
-
-
Save necrolyte2/6d1909724cc5af35e8e4d5aebdba3ac8 to your computer and use it in GitHub Desktop.
Packer ssh_timeout issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1;32mqemu output will be in this color.[0m | |
[1;32m==> qemu: Downloading or copying ISO[0m | |
[0;32m qemu: Downloading or copying: https://binrepo.target.com/artifactory/cpe-image-build-virtmetal/openstack/tgt-cpe-base-os/tgt-cpe-base-os-v1.0.1.qcow2[0m | |
[1;32m==> qemu: Copying hard drive...[0m | |
[1;32m==> qemu: Resizing hard drive...[0m | |
[1;32m==> qemu: Found port for communicator (SSH, WinRM, etc): 2226.[0m | |
[1;32m==> qemu: Looking for available port between 5900 and 6000 on 127.0.0.1[0m | |
[1;32m==> qemu: Starting VM, booting disk image[0m | |
[0;32m qemu: WARNING: The version of qemu on your host doesn't support display mode. | |
qemu: The display parameter will be ignored.[0m | |
[1;32m==> qemu: Overriding defaults Qemu arguments with QemuArgs...[0m | |
[1;32m==> qemu: Waiting 5s for boot...[0m | |
[1;32m==> qemu: Connecting to VM via VNC[0m | |
[1;32m==> qemu: Typing the boot command over VNC...[0m | |
[1;32m==> qemu: Waiting for SSH to become available...[0m | |
[1;32m==> qemu: Connected to SSH![0m | |
[1;32m==> qemu: Provisioning with shell script: /tmp/packer-shell613111759[0m | |
[0;32m qemu: ChallengeResponseAuthentication yes[0m | |
[0;32m qemu: UsePAM yes[0m | |
[0;32m qemu: Protocol 2[0m | |
[0;32m qemu: LogLevel INFO[0m | |
[0;32m qemu: X11Forwarding no[0m | |
[0;32m qemu: MaxAuthTries 3[0m | |
[0;32m qemu: IgnoreRhosts yes[0m | |
[0;32m qemu: PermitEmptyPasswords no[0m | |
[0;32m qemu: PermitUserEnvironment no[0m | |
[0;32m qemu: ClientAliveInterval 300[0m | |
[0;32m qemu: ClientAliveCountMax 0[0m | |
[0;32m qemu: Banner /etc/issue[0m | |
[0;32m qemu: SyslogFacility AUTHPRIV[0m | |
[0;32m qemu: PasswordAuthentication yes[0m | |
[0;32m qemu: GssapiAuthentication yes[0m | |
[0;32m qemu: GssapiCleanUpCredentials yes[0m | |
[0;32m qemu: PrintMotd yes[0m | |
[0;32m qemu: Subsystem sftp /usr/libexec/openssh/sftp-server[0m | |
[0;32m qemu: Acceptenv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL LANGUAGE XMODIFIERS[0m | |
[0;32m qemu: MACs hmac-ripemd160,hmac-sha2-256,hmac-sha2-512[0m | |
[0;32m qemu: PermitRootLogin no[0m | |
[0;32m qemu: Ciphers aes128-ctr,aes192-ctr,aes256-ctr[0m | |
[0;32m qemu: DenyUsers bin[0m | |
[0;32m qemu: DenyUsers daemon[0m | |
[0;32m qemu: DenyUsers adm[0m | |
[0;32m qemu: DenyUsers lp[0m | |
[0;32m qemu: DenyUsers mail[0m | |
[0;32m qemu: DenyUsers uucp[0m | |
[0;32m qemu: DenyUsers operator[0m | |
[0;32m qemu: DenyUsers games[0m | |
[0;32m qemu: DenyUsers gopher[0m | |
[0;32m qemu: DenyUsers ftp[0m | |
[0;32m qemu: DenyUsers nobody[0m | |
[0;32m qemu: DenyUsers vcsa[0m | |
[0;32m qemu: DenyUsers rpc[0m | |
[0;32m qemu: DenyUsers saslauth[0m | |
[0;32m qemu: DenyUsers postfix[0m | |
[0;32m qemu: DenyUsers rpcuser[0m | |
[0;32m qemu: DenyUsers nfsnobody[0m | |
[0;32m qemu: DenyUsers sshdChallengeResponseAuthentication yes[0m | |
[0;32m qemu: UsePAM yes[0m | |
[0;32m qemu: Protocol 2[0m | |
[0;32m qemu: LogLevel INFO[0m | |
[0;32m qemu: X11Forwarding no[0m | |
[0;32m qemu: MaxAuthTries 3[0m | |
[0;32m qemu: IgnoreRhosts yes[0m | |
[0;32m qemu: PermitEmptyPasswords no[0m | |
[0;32m qemu: PermitUserEnvironment no[0m | |
[0;32m qemu: ClientAliveInterval 3600[0m | |
[0;32m qemu: ClientAliveCountMax 0[0m | |
[0;32m qemu: Banner /etc/issue[0m | |
[0;32m qemu: SyslogFacility AUTHPRIV[0m | |
[0;32m qemu: PasswordAuthentication yes[0m | |
[0;32m qemu: GssapiAuthentication yes[0m | |
[0;32m qemu: GssapiCleanUpCredentials yes[0m | |
[0;32m qemu: PrintMotd yes[0m | |
[0;32m qemu: Subsystem sftp /usr/libexec/openssh/sftp-server[0m | |
[0;32m qemu: Acceptenv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL LANGUAGE XMODIFIERS[0m | |
[0;32m qemu: MACs hmac-ripemd160,hmac-sha2-256,hmac-sha2-512[0m | |
[0;32m qemu: PermitRootLogin no[0m | |
[0;32m qemu: Ciphers aes128-ctr,aes192-ctr,aes256-ctr[0m | |
[0;32m qemu: DenyUsers bin[0m | |
[0;32m qemu: DenyUsers daemon[0m | |
[0;32m qemu: DenyUsers adm[0m | |
[0;32m qemu: DenyUsers lp[0m | |
[0;32m qemu: DenyUsers mail[0m | |
[0;32m qemu: DenyUsers uucp[0m | |
[0;32m qemu: DenyUsers operator[0m | |
[0;32m qemu: DenyUsers games[0m | |
[0;32m qemu: DenyUsers gopher[0m | |
[0;32m qemu: DenyUsers ftp[0m | |
[0;32m qemu: DenyUsers nobody[0m | |
[0;32m qemu: DenyUsers vcsa[0m | |
[0;32m qemu: DenyUsers rpc[0m | |
[0;32m qemu: DenyUsers saslauth[0m | |
[0;32m qemu: DenyUsers postfix[0m | |
[0;32m qemu: DenyUsers rpcuser[0m | |
[0;32m qemu: DenyUsers nfsnobody[0m | |
[0;32m qemu: DenyUsers sshd[0m | |
[1;32m==> qemu: Provisioning with shell script: sleep.sh[0m | |
[0;32m qemu: + sleep_time_minutes=10[0m | |
[0;32m qemu: + echo 'Sleeping for 10 minutes'[0m | |
[0;32m qemu: Sleeping for 10 minutes[0m | |
[0;32m qemu: + sleep 600[0m | |
[1;32m==> qemu: Provisioning with shell script: test.sh[0m | |
[0;32m qemu: + echo 'Doing some stuff'[0m | |
[0;32m qemu: Doing some stuff[0m | |
[0;32m qemu: + sleep 5[0m | |
[0;32m qemu: + echo 'Done doing stuff'[0m | |
[0;32m qemu: Done doing stuff[0m | |
[1;32m==> qemu: Gracefully halting virtual machine...[0m | |
[1;32m==> qemu: Converting hard drive...[0m | |
[1;32mBuild 'qemu' finished.[0m | |
==> Builds finished. The artifacts of successful builds are: | |
--> qemu: VM files in directory: output_worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux | |
sleep_time_minutes=10 | |
echo "Sleeping for $sleep_time_minutes minutes" | |
sleep $(($sleep_time_minutes * 60)) | |
echo "Done sleeping" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
}, | |
"builders": [{ | |
"type": "qemu", | |
"machine_type": "rhel6.6.0", | |
"qemu_binary": "/usr/libexec/qemu-kvm", | |
"iso_url": "somebaseimage.qcow2", | |
"iso_checksum": "md5sum", | |
"iso_checksum_type": "md5", | |
"output_directory": "output_worker", | |
"shutdown_command": "sudo /sbin/shutdown -P now", | |
"disk_size": 122880, | |
"format": "qcow2", | |
"headless": false, | |
"accelerator": "kvm", | |
"ssh_host_port_min": 2222, | |
"ssh_host_port_max": 2229, | |
"ssh_username": "centos", | |
"ssh_password": "password", | |
"ssh_port": 22, | |
"ssh_wait_timeout": "20m", | |
"vm_name": "cpe-metal-k8s-worker", | |
"net_device": "virtio-net", | |
"disk_interface": "virtio", | |
"disk_image": "true", | |
"boot_wait": "5s", | |
"boot_command":[], | |
"qemuargs": [ | |
[ "-m", "1024M"], | |
[ "-cdrom", "seed.iso" ] | |
] | |
}], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"inline": [ | |
"sudo cat /etc/ssh/sshd_config", | |
"sudo sed -i 's/ClientAliveInterval.*/ClientAliveInterval 3600/' /etc/ssh/sshd_config", | |
"sudo cat /etc/ssh/sshd_config" | |
] | |
}, | |
{ | |
"type": "shell", | |
"start_retry_timeout": "20m", | |
"environment_vars": [ | |
], | |
"expect_disconnect": true, | |
"execute_command": "echo 'cloud-user' | {{.Vars}} sudo -E -S bash '{{.Path}}'", | |
"scripts": [ | |
"sleep.sh", | |
"test.sh" | |
] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux | |
echo "Doing some stuff" | |
sleep 5 | |
echo "Done doing stuff" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment