@Sample(name="vm-create",
description="This sample creates a VM")
public class VMCreate
extends ConnectedVimServiceBase
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]
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
VMCreate() |
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
void |
setCpuCount(java.lang.String cpuCount) |
void |
setDataCenterName(java.lang.String dcname) |
void |
setDataStore(java.lang.String dsname) |
void |
setDiskSize(java.lang.String size) |
void |
setGuestOsId(java.lang.String guestOsId) |
void |
setHostname(java.lang.String hostname) |
void |
setMemorySize(java.lang.String memorySize) |
void |
setVirtualMachineName(java.lang.String vmname) |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection@Option(name="vmname",
description="Name of the virtual machine")
public void setVirtualMachineName(java.lang.String vmname)
@Option(name="datacentername",
description="Name of the datacenter")
public void setDataCenterName(java.lang.String dcname)
@Option(name="hostname",
description="Name of the host")
public void setHostname(java.lang.String hostname)
@Option(name="guestosid",
required=false,
description="Type of Guest OS [Windows|Posix]")
public void setGuestOsId(java.lang.String guestOsId)
@Option(name="cpucount",
required=false,
description="Total cpu count")
public void setCpuCount(java.lang.String cpuCount)
@Option(name="disksize",
required=false,
description="Size of the Disk")
public void setDiskSize(java.lang.String size)
@Option(name="memorysize",
required=false,
description="Size of Memory in 1024MB blocks")
public void setMemorySize(java.lang.String memorySize)
@Option(name="datastorename",
required=false,
description="Name of dataStore")
public void setDataStore(java.lang.String dsname)
@Action
public void run()
throws com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.VmConfigFaultFaultMsg,
com.vmware.vim25.AlreadyExistsFaultMsg,
com.vmware.vim25.InvalidDatastoreFaultMsg,
com.vmware.vim25.FileFaultFaultMsg,
com.vmware.vim25.InvalidStateFaultMsg,
com.vmware.vim25.InvalidCollectorVersionFaultMsg,
com.vmware.vim25.InvalidNameFaultMsg,
com.vmware.vim25.OutOfBoundsFaultMsg,
com.vmware.vim25.DuplicateNameFaultMsg,
com.vmware.vim25.InsufficientResourcesFaultFaultMsg,
com.vmware.vim25.InvalidPropertyFaultMsg,
java.rmi.RemoteException,
com.vmware.vim25.TaskInProgressFaultMsg
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.VmConfigFaultFaultMsgcom.vmware.vim25.AlreadyExistsFaultMsgcom.vmware.vim25.InvalidDatastoreFaultMsgcom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.InvalidStateFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.InvalidNameFaultMsgcom.vmware.vim25.OutOfBoundsFaultMsgcom.vmware.vim25.DuplicateNameFaultMsgcom.vmware.vim25.InsufficientResourcesFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgjava.rmi.RemoteExceptioncom.vmware.vim25.TaskInProgressFaultMsg