Package com.vmware.vm

Class VMDiskCreate


  • @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
     
    • Constructor Detail

      • VMDiskCreate

        public VMDiskCreate()
    • Method Detail

      • setVirtualMachineName

        @Option(name="vmname",
                required=false,
                description="Name of the virtual machine")
        public void setVirtualMachineName​(java.lang.String name)
      • setDataStoreName

        @Option(name="datastorename",
                required=false,
                description="name of the DataStore")
        public void setDataStoreName​(java.lang.String name)
      • setDiskSize

        @Option(name="disksize",
                description="Size of the virtual disk in MB")
        public void setDiskSize​(java.lang.String size)
      • setDisktype

        @Option(name="disktype",
                required=false,
                description="Virtual Disk Type\n[thin | preallocated | eagerzeroed | rdm | rdmp]")
        public void setDisktype​(java.lang.String type)
      • setPersistence

        @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)
      • setDevicename

        @Option(name="devicename",
                required=false,
                description="Canonical name of the LUN to use for disk types")
        public void setDevicename​(java.lang.String name)
      • init

        @Before
        public void init()
      • run

        @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
        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