VMware Cloud Community
Darwyn99
Contributor
Contributor

script changing the configured OS on next reboot

Hi,


I've seen scripts where you can automatically upgrade the VM hardware version on the next reboot.  That thread is here:

Re: Schedule VM Compatibility Upgrade

I"m wondering if there's a similar method to change the configured OS on the next reboot?  I know you can only change the Configured OS only when the system is powered off.  We have a large number of systems where the running OS is different than the configured OS.  Our servers reboot once a month for Windows patching and when they do, I'd like to update the configured OS to match the running OS during that reboot in an automated fashion.


Thanks for any help.

0 Kudos
1 Reply
LucD
Leadership
Leadership

I'm afraid there is no such option to schedule the change of the configured guest OS.


You will in any case need to power off the VM, a reboot of the guest OS is not sufficient afaik.

You have a couple of alternatives:

  1. Let the handling of the patching/reboot and the change of the configured guest OS be done through the same script
  2. Create an alarm that fires when a VM is powered off, and in the alarm run a script that does the reconfig of the guest OS. Problem here might be that it is not too obvious to run scripts from an alarm when you are using a VCSA (vs a vCenter on a Windows OS)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos