| Class | Description |
|---|---|
| VMClone |
VMClone
This sample makes a template of an existing VM and
deploy multiple instances of this template onto a datacenter
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
datacentername [required] : name of Datacenter
vmpath [required] : inventory path of the VM
clonename [required] : name of the clone
Command Line:
java com.vmware.vm.VMClone --url [webserviceurl]
--username [username] --password [password]
--datacentername [DatacenterName]"
--vmpath [vmPath] --clonename [CloneName]
|
| VMCreate |
VMCreate
This sample creates a VM
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
vmname [required] : Name of the virtual machine
datacentername [required] : Name of the datacenter
hostname [required] : Name of the host
guestosid [optional] : Type of Guest OS
cpucount [optional] : Total cpu count
disksize [optional] : Size of the Disk
memorysize [optional] : Size of the Memory in 1024MB blocks
datastorename [optional] : Name of dataStore
Command Line:
Create a VM given datacenter and host names
run.bat com.vmware.vm.VMCreate --url [webserviceurl]
--username [username] --password [password] --vmname [vmname]
--datacentername [DataCenterName] --hostname [hostname]
Create a VM given its name, Datacenter name and GuestOsId
run.bat com.vmware.vm.VMCreate --url [webserviceurl]
--username [username] --password [password] --vmname [vmname]
--datacentername [DataCenterName] --guestosid [GuestOsId]
Create a VM given its name, Datacenter name and its cpucount
run.bat com.vmware.vm.VMCreate --url [webserviceurl]
--username [username] --password [password] --vmname [vmname]
--datacentername [DataCenterName] --cpucount [cpucount]
|
| VMDeltaDisk |
VMDeltaDisk
This sample creates a delta disk on top of an existing virtual disk in a VM,
and simultaneously removes the original disk using the reconfigure API.
|
| VMDiskCreate |
VMDiskCreate
This sample demonstrates how to create a virtual disk
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
vmname [required] : Name of the virtual machine
datastorename [optional] : name of the DataStore
disksize [required] : Size of the virtual disk in MB
disktype [optional] : Virtual Disk Type
[thin | preallocated | eagerzeroed | rdm | rdmp]
persistence [optional] : Persistence mode of the virtual disk
[persistent | independent_persistent | independent_nonpersistent]
devicename [optional] : Canonical name of the LUN to use for disk types
Command Line:
VMDiskCreate --url [webserviceurl]
--username [username] --password [password]
--vmname [vmname] --disksize [8]
--disktype [thin | preallocated | eagerzeroed | rdm | rdmp]
--persistence [persistent | independent_persistent | independent_nonpersistent]
--devicename vmhba0:0:0:0
|
| VMLinkedClone |
VMLinkedClone
This sample creates a linked clone from an existing snapshot
Each independent disk needs a DiskLocator with
diskmovetype as moveAllDiskBackingsAndDisallowSharing
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
vmname [required] : Name of the virtual machine
snapshotname [required] : Name of the snaphot
clonename [required] : Name of the cloneName
Command Line:
Create a linked clone
run.bat com.vmware.vm.VMLinkedClone --url [webserviceurl]
--username [username] --password [password] --vmname [myVM]
--snapshotname [snapshot name] --clonename [clone name]
|
| VMManageCD |
VMManageCD
This sample adds / removes CDROM to / from an existing VM
This sample lists information about a VMs CDROMs
This sample updates an existing CDROM a VM
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
vmname [required] : name of the virtual machine
operation [required] : operation type - [get|add|remove|set]
isopath [optional] : full datastore path to the iso file
remote [optional] : Specify the device is a remote or client device or iso
startconnected [optional] : virtual CD starts connected when VM powers on
connect [optional] : virtual CD is connected after creation or update
Set only if VM is powered on
label [optional] : used to find the device.key value
devicename [optional] : Specify the path to the CD on the VM's host
Command Line:
Get CD-Rom Info");
run.bat com.vmware.vm.VMManageCD
--url [webserviceurl] --username [username] --password [password]
--operation get --vmname [Virtual Machine Name]
Add CD-Rom
run.bat com.vmware.vm.VMManageCD
--url [webserviceurl] --username [username] --password [password]
--operation add --vmname [Virtual Machine Name]
--isoPath "[datastore1] test.iso" --remote false --connect true
Remove CD-Rom
run.bat com.vmware.vm.VMManageCD
--url [webserviceurl] --username [username] --password [password]
--operation remove --vmname [Virtual Machine Name]
--label CD\\DVD Drive 1
Reconfigure CD-Rom
run.bat com.vmware.vm.VMManageCD
--url [webserviceurl] --username [username] --password [password]
--operation set --vmname [Virtual Machine Name]
--label CD\\DVD Drive 1 --connect false
|
| VMManageFloppy |
VMManageFloppy
This sample adds / removes floppy to / from an existing VM
This sample lists information about a VMs Floppies
This sample updates an existing floppy drive on a VM
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
vmname [required] : name of the virtual machine
operation [required] : operation type - [get|add|remove|set]
imgpath [optional] : path of image file
remote [optional] : device is a remote or client device or iso
startconnected [optional] : virtual floppy starts connected on VM poweron
connect [optional] : virtual floppy is connected
Set only if the VM is powered on
label [optional] : used to find the device.key value
device [optional] : path to the floppy on the VM's host
Command Line:
Get Floppy Info");
run.bat com.vmware.vm.VMManageFloppy
--url [webserviceurl] --username [username] --password [password]
--operation get --vmname [Virtual Machine Name]
Add Floppy
run.bat com.vmware.vm.VMManageFloppy
--url [webserviceurl] --username [username] --password [password]
--operation add --vmname [Virtual Machine Name]
--imgpath test.flp --remote false --connect true
Remove Floppy
run.bat com.vmware.vm.VMManageFloppy
--url [webserviceurl] --username [username] --password [password]
--operation remove --vmname [Virtual Machine Name]
--label Floppy Drive 1
Reconfigure Floppy
run.bat com.vmware.vm.VMManageFloppy
--url [webserviceurl] --username [username] --password [password]
--operation set --vmname [Virtual Machine Name]
--label Floppy Drive 1 --connect false
|
| VMotion |
VMotion
Used to validate if VMotion is feasible between two hosts or not,
It is also used to perform migrate/relocate task depending on the data given
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
vmname [required] : name of the virtual machine
targethost [required] : Name of the target host
sourcehost [required] : Name of the host containing the virtual machine
targetpool [required] : Name of the target resource pool
targetdatastore [required] : Name of the target datastore
priority [required] : The priority of the migration task:-
default_Priority, high_Priority,low_Priority
state [optional]
Command Line:
run.bat com.vmware.vm.VMotion --url [URLString] --username [User] --password [Password]
--vmname [VMName] --targethost [Target host] --sourcehost [Source host] --targetpool [Target resource pool]
--targetdatastore [Target datastore] --priority [Migration task priority] --state
|
| VMPowerOps |
VMPowerOps
Demonstrates VirtualMachine Power operations on multiple Virtual Machines.
|
| VMPromoteDisks |
VMPromoteDisks
Used to consolidate a linked clone by using promote API.
|
| VMReconfig |
VMReconfig
Reconfigures a virtual machine, which include reconfiguring the disk size, disk mode, etc.
|
| VMRelocate |
VMRelocate
Used to relocate a linked clone using disk move type
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
vmname [required] : name of the virtual machine
diskmovetype [required] : Either of
[moveChildMostDiskBacking | moveAllDiskBackingsAndAllowSharing]
datastorename [required] : Name of the datastore
Command Line:
run.bat com.vmware.vm.VMRelocate --url [URLString] --username [User] --password [Password]
--vmname [VMName] --diskmovetype [DiskMoveType] --datastorename [Datastore]
|
| VMSnapshot |
VMSnapshot
This sample demonstrates VM snapshot operations
Parameters:
url [required] : url of the web service.
|
| XVCvMotion |
XVCvMotion
Used to Relocate VM from one VC to another.
|
| XVMotion |