Virtual machines - mount volumes

Use this command to mount volumes to a virtual machine.

Format:

virtualmachine.mountedvolumes + = [<list of dict object>] or (dict object)
dict= {
     "volume": (volume object),
     "mount_point": (string)
 }

Example:

admin.virtualmachines[0].mountedvolumes += {
    "volume":admin.volumes[0], 
    "mount_point": "/test_mount_point"
}

admin.virtualmachines[0].mountedvolumes += [
    {
        "volume":admin.volumes[0], 
        "mount_point":"/test_mount_point_1"
    }, 
    {
        "volume":admin.volumes[1], 
        "mount_point":"/test_mount_point_2"
    }
]

When a volume is added to a virtual machine it is not usable until the volume is formatted and the creation of a valid partition is performed. To validate that the volume is attached successfully, use the following command:

fdisk -l

When this command is entered the volume is listed, but is not formatted and does not contain a valid partition. The following example displays typical results when the fdisk -l command is entered.

Disk /dev/sda: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00005a0f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1306    10484736   83  Linux
/dev/sda2            1306        1567     2097152   82  Linux swap / Solaris
Disk /dev/sda: 12.9 GB, 12884901888 bytes

Disk /dev/sdb: 10 MB, 10485760 bytes
1 heads, 20 sectors/track, 1024 cylinders
Units = cylinders of 20 * 512 = 10240 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

When the fdisk -l command is entered and the volume is not listed, you must restart the virtual machine.