Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packer build does not complete using builder-xenserver-iso #31

Open
lgw4 opened this issue May 20, 2015 · 5 comments
Open

packer build does not complete using builder-xenserver-iso #31

lgw4 opened this issue May 20, 2015 · 5 comments

Comments

@lgw4
Copy link

lgw4 commented May 20, 2015

First, I want to thank everyone involved with this project. I am so close to being able to automate my XenServer VM build process. However, after successfully building and shutting down the VM, the packer build process never completes. I'm running on Debian 8 with Go 1.3.3 linux/amd64. My target XenServer version is 6.2.

packer build output: https://gist.github.com/lgw4/83fa958b6f75823b6cc6
Packer template: https://gist.github.com/lgw4/94de124dc60c961087d3
Kickstart file: https://gist.github.com/lgw4/34876ac51baff283050b

Thank you in advance for any ideas on how I can correct this.

@rdobson
Copy link
Contributor

rdobson commented May 21, 2015

Hi @lgw4,

Have you tried removing the shutdown parameter:
"shutdown_command": "/sbin/halt",

In which case you'll probably need to add a delay on the shutdown (to prevent it from leaving the connection in a hung state).

@lgw4
Copy link
Author

lgw4 commented May 21, 2015

Thanks for the quick reply, @rdobson.

However, when I add a value for shutdown_timeout to my template JSON file per the docs, I get an error.

$ packer validate centos-7.1.json 
Template validation failed. Errors are shown below.

Errors validating build 'xenserver-iso'. 1 error(s) occurred:

* Unknown configuration key: "shutdown_timeout"

I'm sure I'm missing something painfully obvious.

@rdobson
Copy link
Contributor

rdobson commented May 22, 2015

Hmm, perhaps the docs could be clearer. That timeout is actually for how long packer should wait before it reports a failure to shutdown the VM. I.e. after its executed the command in question.

Did you try removing the shutdown command from the template all together?

@lgw4
Copy link
Author

lgw4 commented May 22, 2015

Thanks again for the quick reply.

I did, and I get this error:

==> xenserver-iso: Waiting for SSH to become available...
==> xenserver-iso: Connected to SSH!
==> xenserver-iso: Step: Shutting down VM
    xenserver-iso: Attempting to cleanly shutdown the VM...
==> xenserver-iso: Could not shut down VM: API Error: [VM_MISSING_PV_DRIVERS OpaqueRef:cb46fcbd-8baa-9d22-e869-f3cd672cb503]
==> xenserver-iso: WARNING: Forcing hard shutdown of the VM...
    xenserver-iso: Successfully shut down VM
==> xenserver-iso: Step: Start VM Paused
==> xenserver-iso: Unpausing VM 08da6f8f-2cfe-b934-5ce9-fb40598f46a3
==> xenserver-iso: Waiting 10s for boot...
==> xenserver-iso: Waiting for SSH to become available...
==> xenserver-iso: Timeout waiting for SSH.
==> xenserver-iso: Destroying VM
==> xenserver-iso: Destroying VDI
==> xenserver-iso: Deleting output directory...
Build 'xenserver-iso' errored: Timeout waiting for SSH.

==> Some builds didn't complete successfully and had errors:
--> xenserver-iso: Timeout waiting for SSH.

==> Builds finished but no artifacts were created.

@rdobson
Copy link
Contributor

rdobson commented Jun 19, 2015

Looks like SSH is not working when the VM is restarted:

==> xenserver-iso: Waiting for SSH to become available...
==> xenserver-iso: Timeout waiting for SSH.

Were you able to have a look at the console to see what was going on? Did the VM boot? Could you SSH in manually? (check the IP address Packer tried to connect to from the logs and make sure that hasn't changed too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants