@Sample(name="put-vm-files",
description="This sample puts VM files in specified Datacenter and Datastore and register and reconfigure the particular VM. The VM you use, should be downloaded from the vSphere you are uploading to. The name of the VM, VM folder, and VM disk files should all be the same. The name of the VM should be unique and unused on the Host. This works best if you use a VM you obtained through GetVMFiles.")
public class PutVMFiles
extends ConnectedVimServiceBase
PutVMFiles This sample puts VM files in specified Datacenter and Datastore and register and reconfigure the particular 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 localpath [required]: Local path containing virtual machine files datacentername [required]: Name of the target datacenter datastorename [required]: Name of the target datastore Command Line: run.bat com.vmware.httpfileaccess.PutVMFiles --url [URLString] --username [username] --password [password] --vmname [VM name] --localpath [local path] --datacentername [datacenter name] --datastorename [datastore name]
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
PutVMFiles() |
| Modifier and Type | Method and Description |
|---|---|
void |
copyDir(java.lang.String dirName)
Copy contents of this directory up to the datastore
|
void |
run()
main method
|
void |
setDatacenter(java.lang.String datacenter) |
void |
setDatastore(java.lang.String datastore) |
void |
setLocalPath(java.lang.String localPath) |
void |
setVerbose(java.lang.Boolean verbosity) |
void |
setVmName(java.lang.String vmName) |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection@Option(name="vmname",
description="Name of the virutal machine to upload. Should be unique and unused. Should be the same as the name of the vm folder and vm file names.")
public void setVmName(java.lang.String vmName)
@Option(name="localpath",
description="Local path from which files will be copied. This should be the path holding the virtual machine folder but not the vm folder itself.")
public void setLocalPath(java.lang.String localPath)
@Option(name="datacentername",
description="Name of the target datacenter")
public void setDatacenter(java.lang.String datacenter)
@Option(name="datastorename",
description="Name of the target datastore")
public void setDatastore(java.lang.String datastore)
@Option(name="verbose",
required=false,
description="defaults to \'true\' and prints more information, set to \'false\' to print less.")
public void setVerbose(java.lang.Boolean verbosity)
public void copyDir(java.lang.String dirName)
dirName - @Action
public void run()
throws com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.InvalidPropertyFaultMsg
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsg