vm-reprovision

Usage

avcli vm-reprovision --name name [--new-name name] [--description "description"] [--cpu number] [--memory size] [--addVolumes volumes] [--deleteVolumes volumes] [--keepVolumes volumes] [--interfaces networks] [--disabled-interfaces networks] [--detach-boot-volume] [--attach-boot-volume name]

Description

The vm-reprovision command reprovisions the specified VM.

Options

--name name

Specify the VM to reprovision. Reprovision only one VM at a time. Specify a VM either by name or ID.

--new-name name Specify a new name for the VM.
--description "description " Specify a description for the VM.
--cpu number

The number of virtual CPUs. This defaults to the VM's current amount.

--memory size The size of memory, in megabytes. This defaults to the VM's current amount.
--addVolumes volumes

The list of volumes to attach to this VM. A volume is made up of five components, separated by commas:

  • Size of the volume; required.
    By default, the volume size is specified in megabytes, but you can use standard qualifiers such as KB, MB, GB, and TB.
  • Storage-group name or ID from which to carve storage.
  • Volume name.
  • Volume disk image format (raw or qcow2).
  • Sector size of the volume (512 or 4096).
    • The sector size is in bytes (B), 512 B by default.
    • If the sector size of the storage group is 512 B, the sector size of the volume must be 512 B.

    • If the sector size of the storage group is in 4096 B (4 kB), both 512 B and 4096 B are supported as the sector size of the volume.

    • The boot volume must be presented with 512 B as the sector size.

--deleteVolumes volumes The list of volume(s) that are currently attached to the specified VM to be deleted. Specify a volume either by name or ID.
--keepVolumes volumes The list of volume(s) that are currently attached to the specified VM to be kept attached to the VM. If you specify a volume that is currently attached but not specified in this list, the volume is detached (not destroyed) from the VM. Specify a volume either by name or ID.
--interfacesnetworks, MAC address The list of networks to attach to the VM. Specify a network only once. The attached network must not be private. Optionally, specify the MAC address after the network name.
--disabled-interfaces networks, MAC address A list of networks to attach to the VM, but which should not be enabled. Specify a network only once. The attached network must not be private. Optionally, specify the MAC address after the network name.
--detach-boot-volume Detaches the VM's boot volume.
--attach-boot-volumename Specify the name of a new boot volume for this VM. If the VM already has an attached boot volume, you must also specify --detach-boot-volume; otherwise, the command fails.

Examples

$ avcli vm-reprovision --cpu 2 --name vm1
$ avcli vm-reprovision --cpu 2 --name vm:o100
$ avcli vm-reprovision --cpu 2 --memory 2048 --name vm:o100
Reprovision a VM named vm001 that has a CPU, 512 MB of memory, a 1,024 MB volume and is attached to network0, and then allocate storage from Pool-0001 for the volume. The volume is named vm001_vol0.
$ avcli vm-reprovision --cpu 1 --memory 512 --interfaces network0 \
--addVolumes 1024,Pool-0001,vm001_vol0 --name vm1
Reprovision VM vm1, and then delete the volumes volume:o411, data-vm1, and data-vm2 associated with it.
$ avcli vm-reprovision --deleteVolumes volume:o411 data-vm1 data-vm2 --name vm1
Reprovision VM vm1 with the new data volume data-1-7, delete volume volume:o1043, keep volumes volume:o1, volume:o2, volume:o4, and attach network interfaces sharednetwork:o129 and sharednetwork:o130.
$ avcli vm-reprovision --cpu 3 --memory 3359 --addVolume 2500,storagegroup:o54,data-1-7 --deleteVolumes volume:o1043 --keepVolumes volume:o1 volume:o2 volume:o4 --interfaces sharednetwork:o129 sharednetwork:o130 --name vm1
Reprovision VM vm1 with the same parameters from the previous example. Also rename the VM vm2 and add a description.
$ avcli vm-reprovision --cpu 3 --memory 3359 --addVolumes 2500,storagegroup:o54,data-1-7,qcow2 --deleteVolumes volume:o1043 --keepVolumes volume:o1 volume:o2 volume:o4 --interfaces sharednetwork:o129 sharednetwork:o130 --name vm1 --new-name vm2 --description "This is the vm description"
Reprovision VM vm001 with two CPUs, 2048 MB of memory, one new data volume vm001_data1 in qcow2 format with 4 kB sector size, and keep volume o7517.
$ avcli vm-reprovision --cpu 2 --memory 2048 --addVolumes 20GB,storagegroup:o1090,vm001_data1,qcow2,4096 --keepVolumes volume:o7517 --name vm001

Swap two VMs' boot disks.

Detach boot volume:
$ avcli vm-reprovision --detach-boot-volume --name p56xen4
Switch boot volume:
$ avcli vm-reprovision --detach-boot-volume --attach-boot-volume boot-p56xen4 --name p56xen8
Attach a detached boot volume to a different VM:
$ avcli vm-reprovision --attach-boot-volume boot-p56xen8 --name p56xen4