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

vsphere-iso using ESXi 7.0.0 and CentOS 8 #314

Open
asaf opened this issue May 16, 2020 · 3 comments
Open

vsphere-iso using ESXi 7.0.0 and CentOS 8 #314

asaf opened this issue May 16, 2020 · 3 comments

Comments

@asaf
Copy link

asaf commented May 16, 2020

Hey,
I'm trying to build a CentOS v8 on ESXi 7 hypervisor,
Everything is provisioned right but at the end of the process I see the error:

Build 'vsphere-iso' errored: ServerFaultCode: The operation is not supported on the object.

This seems to be an ESXi error. any clue?

full log

==> vsphere-iso: Set boot order...
==> vsphere-iso: Power on VM...
==> vsphere-iso: Waiting 10s for boot...
==> vsphere-iso: Typing boot command...
==> vsphere-iso: Waiting for IP...
==> vsphere-iso: IP address: 192.168.24.136
==> vsphere-iso: Using ssh communicator to connect: 192.168.24.136
==> vsphere-iso: Waiting for SSH to become available...
==> vsphere-iso: Connected to SSH!
==> vsphere-iso: Provisioning with shell script: /var/folders/h2/nnw7l4kx769ghtk1yrtp07d80000gn/T/packer-shell280388230
    vsphere-iso: total 28
    vsphere-iso: dr-xr-x---.  2 root root  137 May 16 15:05 .
    vsphere-iso: dr-xr-xr-x. 17 root root  224 May 16 15:00 ..
    vsphere-iso: -rw-------.  1 root root 1773 May 16 15:05 anaconda-ks.cfg
    vsphere-iso: -rw-r--r--.  1 root root   18 May 11  2019 .bash_logout
    vsphere-iso: -rw-r--r--.  1 root root  176 May 11  2019 .bash_profile
    vsphere-iso: -rw-r--r--.  1 root root  176 May 11  2019 .bashrc
    vsphere-iso: -rw-r--r--.  1 root root  100 May 11  2019 .cshrc
    vsphere-iso: -rw-------.  1 root root 3031 May 16 15:05 original-ks.cfg
    vsphere-iso: -rw-r--r--.  1 root root  129 May 11  2019 .tcshrc
==> vsphere-iso: Shutting down VM...
==> vsphere-iso: Deleting Floppy drives...
==> vsphere-iso: Eject CD-ROM drives...
==> vsphere-iso: Convert VM into template...
==> vsphere-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
==> vsphere-iso: Power off VM...
==> vsphere-iso: Destroying VM...
Build 'vsphere-iso' errored: ServerFaultCode: The operation is not supported on the object.
@VladRassokhin
Copy link
Collaborator

Any chance your provision script shuts down VM?
ESXi prohibits powering off powered off VM (weird, but still).
Try packer version 1.5.6 with hashicorp/packer#9095 merged.

@VladRassokhin
Copy link
Collaborator

Also it's better to open issues in packer issue tracker: https://github.com/hashicorp/packer/issues

@asaf
Copy link
Author

asaf commented May 19, 2020

@VladRassokhin thanks for answering,

What I see is:

vsphere-iso: output will be in this color.

==> vsphere-iso: Creating VM...
==> vsphere-iso: Customizing hardware...
==> vsphere-iso: Mounting ISO images...
==> vsphere-iso: Set boot order...
==> vsphere-iso: Power on VM...
==> vsphere-iso: Waiting 10s for boot...
==> vsphere-iso: Typing boot command...
==> vsphere-iso: Waiting for IP...

Then CentOS kickstart runs, perform installation where its last line is reboot --eject.
Once the VM completes the reboot (post installment) I see the login prompt and then Packer continue with:

==> vsphere-iso: IP address: 192.168.24.136
==> vsphere-iso: Using ssh communicator to connect: 192.168.24.136
==> vsphere-iso: Waiting for SSH to become available...
==> vsphere-iso: Connected to SSH!
==> vsphere-iso: Provisioning with shell script: /var/folders/h2/nnw7l4kx769ghtk1yrtp07d80000gn/T/packer-shell161139403
    vsphere-iso: total 28
    vsphere-iso: dr-xr-x---.  2 root root  137 May 19 16:40 .
    vsphere-iso: dr-xr-xr-x. 17 root root  224 May 19 16:35 ..
    vsphere-iso: -rw-------.  1 root root 1730 May 19 16:40 anaconda-ks.cfg
    vsphere-iso: -rw-r--r--.  1 root root   18 May 11  2019 .bash_logout
    vsphere-iso: -rw-r--r--.  1 root root  176 May 11  2019 .bash_profile
    vsphere-iso: -rw-r--r--.  1 root root  176 May 11  2019 .bashrc
    vsphere-iso: -rw-r--r--.  1 root root  100 May 11  2019 .cshrc
    vsphere-iso: -rw-------.  1 root root 3032 May 19 16:40 original-ks.cfg
    vsphere-iso: -rw-r--r--.  1 root root  129 May 11  2019 .tcshrc
==> vsphere-iso: Shutting down VM...
==> vsphere-iso: Deleting Floppy drives...
==> vsphere-iso: Eject CD-ROM drives...
==> vsphere-iso: Convert VM into template...
==> vsphere-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
==> vsphere-iso: Power off VM...
==> vsphere-iso: Destroying VM...
Build 'vsphere-iso' errored: ServerFaultCode: The operation is not supported on the object.

==> Some builds didn't complete successfully and had errors:
--> vsphere-iso: ServerFaultCode: The operation is not supported on the object.

==> Builds finished but no artifacts were created.

There is no extra reboot once the VM is up, so I'm not sure what's happening,

I tried to build packer from master but there has been configuration changes so now everything got broken, so I'll have to wait with this.

Thanks,

Asaf.

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

No branches or pull requests

2 participants