Package com.vmware.spbm.samples
Class VMCreate
- java.lang.Object
-
- com.vmware.spbm.connection.ConnectedServiceBase
-
- com.vmware.spbm.samples.VMCreate
-
@Sample(name="vm-create", description="This sample creates a VM based on a storage profile.") public class VMCreate extends ConnectedServiceBaseVMCreate This sample creates a VM with a storage policy based management profile. The VM uses the datastores configured with the host. 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 profilename [required] : Name of the storage profile 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, host names and storage profile name run.bat com.vmware.vm.VMCreate --url [webserviceurl] --username [username] --password [password] --vmname [vmname] --datacentername [DataCenterName] --hostname [hostname] --profilename [Storage Profile Name] Create a VM given its name, Datacenter name, storage profile name and GuestOsId run.bat com.vmware.vm.VMCreate --url [webserviceurl] --username [username] --password [password] --vmname [vmname] --datacentername [DataCenterName] --guestosid [GuestOsId] --profilename [Storage Profile Name] Create a VM given its name, Datacenter name, storage profile name and its cpucount run.bat com.vmware.vm.VMCreate --url [webserviceurl] --username [username] --password [password] --vmname [vmname] --datacentername [DataCenterName] --cpucount [cpucount] --profilename [Storage Profile Name]
-
-
Constructor Summary
Constructors Constructor Description VMCreate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()voidsetCpuCount(java.lang.String cpuCount)voidsetDataCenterName(java.lang.String dcname)voidsetDataStore(java.lang.String dsname)voidsetDiskSize(java.lang.String size)voidsetGuestOsId(java.lang.String guestOsId)voidsetHostname(java.lang.String hostname)voidsetMemorySize(java.lang.String memorySize)voidsetProfileName(java.lang.String profileName)voidsetVirtualMachineName(java.lang.String vmname)-
Methods inherited from class com.vmware.spbm.connection.ConnectedServiceBase
setConnection, start, stop
-
-
-
-
Method Detail
-
run
@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.pbm.InvalidArgumentFaultMsg, com.vmware.pbm.RuntimeFaultFaultMsg- Throws:
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.TaskInProgressFaultMsgcom.vmware.pbm.InvalidArgumentFaultMsg
-
setCpuCount
@Option(name="cpucount", required=false, description="Total cpu count") public void setCpuCount(java.lang.String cpuCount)
-
setDataCenterName
@Option(name="datacentername", description="Name of the datacenter") public void setDataCenterName(java.lang.String dcname)
-
setDataStore
@Option(name="datastorename", required=false, description="Name of dataStore") public void setDataStore(java.lang.String dsname)
-
setDiskSize
@Option(name="disksize", required=false, description="Size of the Disk") public void setDiskSize(java.lang.String size)
-
setGuestOsId
@Option(name="guestosid", required=false, description="Type of Guest OS [Windows|Posix]") public void setGuestOsId(java.lang.String guestOsId)
-
setHostname
@Option(name="hostname", description="Name of the host") public void setHostname(java.lang.String hostname)
-
setMemorySize
@Option(name="memorysize", required=false, description="Size of Memory in 1024MB blocks. eg. 2048") public void setMemorySize(java.lang.String memorySize)
-
setProfileName
@Option(name="profilename", description="Name of the storage profile", required=true) public void setProfileName(java.lang.String profileName)
-
setVirtualMachineName
@Option(name="vmname", description="Name of the virtual machine") public void setVirtualMachineName(java.lang.String vmname)
-
-