@Sample(name="vm-disk-create",
description="This sample demonstrates how to create a virtual disk")
public class VMDiskCreate
extends ConnectedVimServiceBase
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
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
VMDiskCreate() |
| Modifier and Type | Method and Description |
|---|---|
void |
init() |
void |
run() |
void |
setDataStoreName(java.lang.String name) |
void |
setDevicename(java.lang.String name) |
void |
setDiskSize(java.lang.String size) |
void |
setDisktype(java.lang.String type) |
void |
setPersistence(java.lang.String persistence) |
void |
setVirtualMachineName(java.lang.String name) |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection@Option(name="vmname",
required=false,
description="Name of the virtual machine")
public void setVirtualMachineName(java.lang.String name)
@Option(name="datastorename",
required=false,
description="name of the DataStore")
public void setDataStoreName(java.lang.String name)
@Option(name="disksize",
description="Size of the virtual disk in MB")
public void setDiskSize(java.lang.String size)
@Option(name="disktype",
required=false,
description="Virtual Disk Type\n[thin | preallocated | eagerzeroed | rdm | rdmp]")
public void setDisktype(java.lang.String type)
@Option(name="persistence",
required=false,
description="Persistence mode of the virtual disk\n[persistent | independent_persistent | independent_nonpersistent]")
public void setPersistence(java.lang.String persistence)
@Option(name="devicename",
required=false,
description="Canonical name of the LUN to use for disk types")
public void setDevicename(java.lang.String name)
@Before public void init()
@Action
public void run()
throws com.vmware.vim25.InvalidPropertyFaultMsg,
com.vmware.vim25.DuplicateNameFaultMsg,
com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.TaskInProgressFaultMsg,
com.vmware.vim25.VmConfigFaultFaultMsg,
com.vmware.vim25.InsufficientResourcesFaultFaultMsg,
com.vmware.vim25.InvalidDatastoreFaultMsg,
com.vmware.vim25.FileFaultFaultMsg,
com.vmware.vim25.ConcurrentAccessFaultMsg,
com.vmware.vim25.InvalidStateFaultMsg,
com.vmware.vim25.InvalidNameFaultMsg,
com.vmware.vim25.InvalidCollectorVersionFaultMsg
com.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.DuplicateNameFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.TaskInProgressFaultMsgcom.vmware.vim25.VmConfigFaultFaultMsgcom.vmware.vim25.InsufficientResourcesFaultFaultMsgcom.vmware.vim25.InvalidDatastoreFaultMsgcom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.ConcurrentAccessFaultMsgcom.vmware.vim25.InvalidStateFaultMsgcom.vmware.vim25.InvalidNameFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsg