A.57 create VmDiskMapping

Maps a virtual disk, physical disk, or CDROM to a virtual machine disk slot.

Syntax

create VmDiskMapping slot=value { physicalDisk=value | virtualDisk=value | virtualCd= { value | EMPTY_CDROM } } name=value [ description=value ] on Vm instance

Where instance is:

{ id=value | name=value }

Description

This command maps a virtual disk, physical disk, or CDROM to a virtual machine disk slot. To create an empty CDROM drive, use the virtualCd=EMPTY_CDROM option. To edit a virtual disk or eject a CDROM, remove it using the delete VmDiskMapping command, then use the create VmDiskMapping command again to remap it to a virtual machine with any changed settings.

Options

The following table shows the available options for this command.

Option

Description

slot=value

The slot number for the disk in the virtual machine This can be an integer between 0 and 1000000.

physicalDisk=value

The name or ID of the physical disk.

VirtualDisk=value

The name or ID of the virtual disk.

virtualCd= { value | EMPTY_CDROM }

The name or ID of the ISO file (virtual CDROM). Alternatively, to create an empty CDROM, use the EMPTY_CDROM option.

name=value

A name to identify the disk mapping.

Tip

To find this name after a virtual disk is mapped to a virtual machine, use the list VmDiskMapping command. You will need the name or ID of this to delete a disk mapping from a virtual machine with the delete VmDiskMapping command.

description=value

Optional description for the disk mapping object. value is a maximum of 4,000 characters.

To set an empty description, use description="".

{ id=value | name=value }

The instance of the object using either the id or name option, for example name=MyVM.

Note

Any create command only creates a single instance of an object, and therefore only accepts a single object instance as an attribute. Providing more than one object of the same attribute type as a parameter always results in the last attribute value taking precedence.

Examples

Example A.73 Mapping a virtual disk to a virtual machine

OVM> create VmDiskMapping slot=0 virtualDisk=MyVMDisk name="Boot Disk" on Vm name=MyVM

Example A.74 Mapping an ISO file (CDROM) to a virtual machine

OVM> create VmDiskMapping slot=1 virtualCd=OracleLinux-dvd.iso \
  name="CDROM Drive" on Vm name=MyVM

Example A.75 Mapping an empty CDROM drive to a virtual machine

OVM> create VmDiskMapping slot=2 virtualCd=EMPTY_CDROM name="CDROM Drive" on Vm name=MyVM

Example A.76 Mapping a physical disk to a virtual machine

OVM> create VmDiskMapping slot=3 physicalDisk=MyPhysicalDisk name="D Drive" on Vm name=MyVM

See Also