vmreconfig.pl - Reconfigure a virtual machine.
vmreconfig.pl [options]
This command provides an interface to reconfigure a virtual machine based on the parameters specified in the valid XML file. The syntax of the XML file is validated against the specified schema file.. Reconfiguring a virtual machine involves the following operations:
Add or Remove NetworkAdapter, Floppy, CD, Disk.
Connect or Disconnect NetworkAdapter, Floppy, CD
Connect the NIC, Floppy, CD when the virtual machine starts.
Increase or Decrease CPU and memory shares.
The user can perform multiple operation at a time. For example a user can add a hard disk, remove a floppy and change the memory shares in a single run. Suppose a user wants to remove a hard disk which is not present and also remove a floppy which exists, then the reconfigure operation will be completed successfully for the floppy but it will ignore the settings for invalid hard disk name because the script will create the device config spec for floppy only. If the XML file only contains the parameters for removing a non-existent disk then the device config spec will not be created and no reconfiguration will be performed.
Optional. The location of the XML file which contains the reconfiguration parameters. If this option is not specified, then the default file 'vmreconfig.xml' will be used from the ``../sampledata'' directory. The user can use this file as a reference to create there own input XML files and specify the file's location using the <filename> option.
Optional. The location of the schema file against which the input XML file is validated. If this option is not specified, then the file 'vmreconfig.xsd' will be used from the ``../schema'' directory. This file need not be modified by the user.
The parameters for creating the virtual machine are specified in an XML file. Choose input parameters for the XML file from the following:
Required. Name of the virtual machine.
Required. Name of the host.
Optional. Name of the device. Each of the NetworkAdapter, Floppy, CD and Disk device has different <Name> element in the XML file.
Optional. Size of the hard disk.
Optional. Mode of the hard disk. The mode must be one of the following:
persistent nonpersistent undoable independent_persistent independent_nonpersistent append
Optional. Name of the device. Each of the NetworkAdapter, Floppy, CD and Disk device has different <Name> element in the XML file.
Optional. Name of the device. Each of the NetworkAdapter, Floppy and CD device has different <Name> element in the XML file.
Optional. Name of the device. Each of the NetworkAdapter, Floppy and CD device has different <Name> element in the XML file.
Optional. Name of the device. Each of the NetworkAdapter, Floppy and CD device has different <Name> element in the XML file.
Optional. Flag to specify whether or not to connect the device when the virtual machine starts. Each of the NetworkAdapter, Floppy and CD device has different <Name> and <PowerOn> element in the XML file. Value must be 'true' or 'false'.
Optional. Value of the CPU share [Integral Value|low|normal|high].
Optional. Value of memory share [Integral Value|low|normal|high].
<?xml version="1.0"?> <Reconfigure-Virtual-Machine> <Name>VMName</Name> <Host>HostName</Host> <Add-Device> <Network-Adapter> <Name>VM Network</Name> </Network-Adapter> <Floppy-Drive> <Name>Floppy1</Name> </Floppy-Drive> <CD-DVD-Drive> <Name>Drive22</Name> </CD-DVD-Drive> <Hard-Disk> <Name>Hard Disk12</Name> <Size>10</Size> <Persistent-Mode>persistent</Persistent-Mode> </Hard-Disk> </Add-Device> <Remove-Device> <Network-Adapter> <Name>VM Network</Name> </Network-Adapter> <Floppy-Drive> <Name>F1</Name> </Floppy-Drive> <CD-DVD-Drive> <Name>CD2</Name> </CD-DVD-Drive> <Hard-Disk> <Name>Disk22</Name> </Hard-Disk> </Remove-Device> <Connect-Device> <Network-Adapter> <Name>VM Network</Name> </Network-Adapter> <Floppy-Drive> <Name>Floppy</Name> </Floppy-Drive> <CD-DVD-Drive> <Name>CD2</Name> </CD-DVD-Drive> </Connect-Device> <Disconnect-Device> <Network-Adapter> <Name>VM Network</Name> </Network-Adapter> <Floppy-Drive> <Name>Floppy</Name> </Floppy-Drive> <CD-DVD-Drive> <Name>CD2</Name> </CD-DVD-Drive> </Disconnect-Device> <PowerOn-Flag> <Network-Adapter> <Name>VM Network</Name> <PowerOn>true</PowerOn> </Network-Adapter> <Floppy-Drive> <Name>Floppy1</Name> <PowerOn>false</PowerOn> </Floppy-Drive> <CD-DVD-Drive> <Name>CD 1</Name> <PowerOn>false</PowerOn> </CD-DVD-Drive> </PowerOn-Flag> <Shares> <CPU></CPU> <Memory></Memory> </Shares> </Reconfigure-Virtual-Machine>
Add a virtual disk with <Name> 'HardDisk 1', <Size> '10' MB and <Persistent-Mode> 'persistent'
vmreconfig.pl --url https://<host>:<port>/sdk/vimService --username myuser --password mypassword --filename vmreconfig.xml --schema vmreconfig.xsd