Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Build 'vsphere' errored: NotAuthenticated #30

Closed
Kutkovsky opened this issue Aug 9, 2017 · 4 comments
Closed

Build 'vsphere' errored: NotAuthenticated #30

Kutkovsky opened this issue Aug 9, 2017 · 4 comments
Labels

Comments

@Kutkovsky
Copy link

Hello, guys!
We are using your plugin to clone VM's and provision them at vSphere 6.5.
Faced up with situation when our job fails with error:

==> vsphere: Executing shutdown command...
packer-builder-vsphere: 2017/08/09 08:04:47 Shutdown command: sudo shutdown -h now
packer-builder-vsphere: 2017/08/09 08:04:47 opening new ssh session
packer-builder-vsphere: 2017/08/09 08:04:47 starting remote command: sudo shutdown -h now
packer-builder-vsphere: 2017/08/09 08:04:47 Waiting max 5m0s for shutdown to complete
==> vsphere: Power off VM...
==> vsphere: NotAuthenticated
==> vsphere: Destroying VM...
==> vsphere: ServerFaultCode: The session is not authenticated.
[INFO] (telemetry) ending vsphere
[INFO] (telemetry) found error: NotAuthenticated
Build 'vsphere' errored: NotAuthenticated

VM clearly shutdown and stays at vSphere (its fine, but our job fails with error). So plugin cannot destroy VM due to not authenticated session also.

Our job takes 3.5 hours usually. So, when we shortened our task to 25 min just for test - it succeed. With any long-duration tries - failed.

I found an article at vmware.com saying that we can increase timeout constraints at vSphere to resolve this:
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2040626
It didn't help us. So I want to ask you, could you add some kind of Keep Alive packets during the job? Or reestablish session to vSphere at the end of the job?

Sure, this will fix this issue.

@mkuzmin mkuzmin added the bug label Aug 14, 2017
@mkuzmin
Copy link
Contributor

mkuzmin commented Aug 14, 2017

This is tricky. I've reproduced it locally, but cannot find a fix yet.

@mkuzmin
Copy link
Contributor

mkuzmin commented Aug 16, 2017

I suppose I've solved that. But please test the fix, before I merge it into master.
https://github.com/jetbrains-infra/packer-builder-vsphere/releases/tag/v.1.3.1.dev1

@Kutkovsky
Copy link
Author

@mkuzmin Sure, will test it today. Thanks

@Kutkovsky
Copy link
Author

@mkuzmin Thanks! Confirm! The bug gone. No more such errors.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants