Guest Customization for Stopped Virtual Machines

You can customize certain settings in the guest operating system with the help of the vSphere Web Services SDK. Customization is simpler for a virtual machine that is not running.
A guest operating system can be easily customized while it is not running. If stopping the guest will cause a significant service impact, such as in an instant clone virtual machine, see Guest Network Customization for Instant Clone Virtual Machines instead.
Use this general procedure to customize a guest operating system that you can shut down without a significant service impact. However, to initialize a virtual machine in a cloud environment, by using the cloud-init utility, see Guest Customization Using cloud-init.
  1. Shut down the guest operating system by using the
    ShutdownGuest
    method or the
    PowerOffVM_Task
    method.
  2. Prepare a
    CustomizationSpec
    data object that specifies the desired global IP settings, virtual NIC settings, and so on.
  3. Invoke the
    CustomizeVM_Task
    method of the
    VirtualMachine
    managed object.
  4. Start the guest operating system by using the
    PowerOnVM_Task
    method of the
    VirtualMachine
    managed object.
For more information about customizing the guest operating system, in the context of virtual machine configuration, see Customizing the Guest Operating System.