VMware Cloud Community
smcdonaldcpr
Contributor
Contributor

Force Guest Shutdown before Destroy of a VM

Hi,

Is there way to set vRA to properly shutdown/do a guest shutdown on a deployed vm before it is destroyed ?  

Any assistance would be appreciated.

0 Kudos
5 Replies
daphnissov
Immortal
Immortal

A shutdown is part of the destruction process (automatically). After all, a VM cannot be deleted in a powered-on state regardless of what's initiating the request.

0 Kudos
ryanrpatel
Enthusiast
Enthusiast

Yes, it should shutdown the VM (assuming VM tools is installed) otherwise it will do a "Power Off" before deleting it.

0 Kudos
daphnissov
Immortal
Immortal

Yes, it should shutdown the VM (assuming VM tools is installed) otherwise it will do a "Power Off" before deleting it.

Are you positive about that? From what I recall, I think it does a power off regardless.

In any case, I'm curious to know OP's use case as to why it matters. After all, it *IS* about to be blown away, so why is shutdown versus power-off significant?

0 Kudos
smcdonaldcpr
Contributor
Contributor

Hi,

The reason is we have engineers that redeploy new VM's with new versions of an OVA using the same DNS name.  When the VM is destroyed without a proper shutdown, the DHCP record becomes orphaned and the DNS is still tied to that destroyed VM's DHCP record.

With a proper shutdown, the destroyed VM's DHCP record is released and DNS record is correctly assigned to newly deployed VM and assigned IP address. 

I have to go in and manually delete the DHCP records manually and reboot the new deployed VM for the DNS to be reachable several times due to Vm's not being shut down.

I have tested this several times between destroying without proper shutdown, and doing a shutdown then destroy, and DNS entry is orphaned every time and I need to manually clear it.

The results of the testing makes me believe when you destroy a VM, it is just powering it off, not doing a proper shutdown/guest shutdown.  To confirm, VMWare Tools is installed on all the OVA's that are being deployed.

Thanks,

0 Kudos
daphnissov
Immortal
Immortal

Are these OVAs not able to take OVF properties that set an IP address? Although vRA does support deploying machines with DHCP, it causes more hassle than it saves.

I don't see a param of the VRM Agent that allows you to choose the shutdown method, so you'll probably have to create an EBS subscription to listen for VMPSMasterWorkflow32.Disposing that calls a guest shutdown vRO workflow (there's a default one in the library).

0 Kudos