Package com.vmware.vm
Class VMClone
- java.lang.Object
-
- com.vmware.connection.ConnectedVimServiceBase
-
- com.vmware.vm.VMClone
-
@Sample(name="vm-clone", description="This sample makes a template of an existing VM and deploy multiple instances of this template onto a datacenter") public class VMClone extends ConnectedVimServiceBaseVMClone This sample makes a template of an existing VM , change target network 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 hostname [optional] : name of the host targetnetworkname [optional] : name of the target network Command Line: java com.vmware.vm.VMClone --url [webserviceurl] --username [username] --password [password] --datacentername [DatacenterName]" --vmpath [vmPath] --clonename [CloneName] --host [hostname] --targetnetworkname [Target Network Name]
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vmware.connection.ConnectedVimServiceBase
ConnectedVimServiceBase.ConnectionException
-
-
Field Summary
-
Fields inherited from class com.vmware.connection.ConnectedVimServiceBase
PROP_ME_NAME, SVC_INST_NAME
-
-
Constructor Summary
Constructors Constructor Description VMClone()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.HashMap<java.lang.String,com.vmware.vim25.VirtualDeviceBackingInfo>getAvailableHostNetworkDevice(com.vmware.vim25.ConfigTarget configTarget)Return the list of any available networks on ESX which will host the VMvoidrun()voidsetCloneName(java.lang.String cloneName)voidsetDataCenterName(java.lang.String dataCenterName)voidsetHostName(java.lang.String hostName)voidsetTargetNetworkName(java.lang.String targetNetworkName)voidsetVmPathName(java.lang.String vmPathName)-
Methods inherited from class com.vmware.connection.ConnectedVimServiceBase
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection
-
-
-
-
Method Detail
-
setDataCenterName
@Option(name="datacentername", description="name of Datacenter") public void setDataCenterName(java.lang.String dataCenterName)
-
setVmPathName
@Option(name="vmpath", description="inventory path of the VM") public void setVmPathName(java.lang.String vmPathName)
-
setCloneName
@Option(name="clonename", description="name of the clone") public void setCloneName(java.lang.String cloneName)
-
setHostName
@Option(name="hostname", required=false, description="name of target host") public void setHostName(java.lang.String hostName)
-
setTargetNetworkName
@Option(name="targetnetworkname", required=false, description="name of the target network Options: Standard|Distributed|Opaque Network") public void setTargetNetworkName(java.lang.String targetNetworkName)
-
getAvailableHostNetworkDevice
public java.util.HashMap<java.lang.String,com.vmware.vim25.VirtualDeviceBackingInfo> getAvailableHostNetworkDevice(com.vmware.vim25.ConfigTarget configTarget) throws com.vmware.vim25.InvalidPropertyFaultMsg, com.vmware.vim25.RuntimeFaultFaultMsgReturn the list of any available networks on ESX which will host the VM- Returns:
- Throws:
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsg
-
run
@Action public void run() throws com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.TaskInProgressFaultMsg, com.vmware.vim25.VmConfigFaultFaultMsg, com.vmware.vim25.InvalidDatastoreFaultMsg, com.vmware.vim25.FileFaultFaultMsg, java.lang.NoSuchMethodException, com.vmware.vim25.MigrationFaultFaultMsg, com.vmware.vim25.InvalidStateFaultMsg, com.vmware.vim25.InvalidCollectorVersionFaultMsg, java.lang.IllegalAccessException, com.vmware.vim25.CustomizationFaultFaultMsg, com.vmware.vim25.InsufficientResourcesFaultFaultMsg, java.lang.reflect.InvocationTargetException, com.vmware.vim25.InvalidPropertyFaultMsg- Throws:
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.TaskInProgressFaultMsgcom.vmware.vim25.VmConfigFaultFaultMsgcom.vmware.vim25.InvalidDatastoreFaultMsgcom.vmware.vim25.FileFaultFaultMsgjava.lang.NoSuchMethodExceptioncom.vmware.vim25.MigrationFaultFaultMsgcom.vmware.vim25.InvalidStateFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgjava.lang.IllegalAccessExceptioncom.vmware.vim25.CustomizationFaultFaultMsgcom.vmware.vim25.InsufficientResourcesFaultFaultMsgjava.lang.reflect.InvocationTargetExceptioncom.vmware.vim25.InvalidPropertyFaultMsg
-
-