Foreman fails to delete a host with vmware-tools installed
Using Foreman 1.2-RC3. A foreman provisioned guest has vmware-tools installed. When a delete is issued against the host, foreman first powers down the machine. VMware assumes that you want a 'clean shutdown', so it uses the vmware-tools interface to shutdown the host. However, this takes more than a couple of seconds, and in the meantime foreman issues the 'delete VM' command. Since the VM is still powered on, this fails and you get an error in the VMware console:
Delete virtual machine:
The attempted operation cannot be performed in the current state (Powered on).
If you try to delete it a second time, it succeeds as the guest OS has finally shut down. Our solution is scripted, power down a machine and wait to issue the delete until VMware says 'its really shutdown'. You could send a 'force' to fog on the shutdown but this would probably only be wise on a delete..
#1 Updated by Kal Aeolian almost 10 years ago
Kal Aeolian wrote:
You could send a 'force' to fog on the shutdown but this would probably only be wise on a delete..
Just to clarify - looking at the fog source, it sends a 'vmware shutdown nicely, please!' instruction unless you specifically add a 'force' option to the command, and then it does a power-off.
#2 Updated by Dominic Cleal almost 10 years ago
- Status changed from New to Closed
- Target version changed from 1.2.0 to 1.3.0
- % Done changed from 0 to 100
This has already been fixed by Ohad in fog, but we're not shipping 1.12.1 in our RPMs for Foreman 1.2, only 1.11.1. 1.12.1 will be shipped as part of Foreman 1.3.
You can use the fog RPM from the nightly repo to get this fix in the meantime, but I'd wait for a new version as you'll hit #2694 by updating to 1.12.1.
Edit: of course, you knew about the other bug, I forgot you'd raised it :)