vm-create

Usage

avcli vm-create --name name --cpu number --memory memory --cdrom cd-name | --kickstart template | --remote-file-path path [--remote-type type] [--remote-username username] [--remote-password password] --availability level [--interfaces networks] [--disabled-interfaces networks] [--storage-group group] --volumes volumes [--wait]

Description

The vm-create command creates a new VM.

Options

--name name

The name of the VM to create.

--cpu number The number of virtual CPUs to assign to the VM.
--memory memory The amount of memory, in megabytes, to assign to the VM.
--cdrom cd-name The CD-ROM from which you initially boot the VM. You cannot specify this option with --kickstart or --remote-file-path.
--kickstart template The kickstart template to use when booting the VM. You cannot specify this option with --cdrom or -- remote-file-path.
--remote-file-path path A remote ISO repository to use when booting the VM. You cannot specify this option with --cdrom or --kickstart.
--remote-type type

The type of remote ISO repository specified in the --remote-file-path option. Valid options are samba or nfs.

--remote-username username The user account to specify for access to the remote ISO repository specified in the --remote-file-path option. Required for samba repositories.
--remote-password password The user password to specify for access to the remote ISO repository specified in the --remote-file-path option. Required for samba repositories.
--availability level The availability level, high availability (ha) or fault tolerant (ft).
--interfaces networks, 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.
--storage-group group The storage group to use to carve VM volumes from. If you do not specify this value, the storage group with the most free space is automatically selected.
--volumes volumes

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.

--wait

-w

Wait for the command to complete.

Examples

Create a HA VM named vm001 with a CPU, 512 MB of memory, a 1,024 MB volume, and that is attached to network0. Connect a remote ISO from an NFS share.
$ avcli vm-create --name vm001 --cpu 1 --memory 512 \
--remote-file-path 134.111.24.224:/developer/windows_7.iso \
--remote-type nfs --availability ha --interfaces network0 \
--volumes 1024
Create a HA VM named vm001 with a CPU, 1024 MB of memory, a 1,024 MB volume, and that is attached to network0. Connect a remote ISO from a Samba share.
$ avcli vm-create --name vm001 --cpu 1 --memory 1024 \
--remote-file-path //134.111.31.228/Users/TEST/windows.iso \
--remote-type samba --remote-username TEST \
--remote-password abc123 --availability ha \
--interfaces network0 --volumes 1024
Create a HA VM named vm001 with a CPU, 512 MB of memory, a 1,024 MB volume, and that is attached to network0.
$ avcli vm-create --name vm001 --cpu 1 --memory 512 \
--cdrom linux.iso --availability ha \
--interfaces network0 --volumes 1024
Create a FT VM named vm001 with a CPU, 512 MB of memory, a 1,024 MB volume, and that is attached to network0. Then allocate storage from Pool-0001 for the volume.
$ avcli vm-create --name vm001 --cpu 1 --memory 512 \
--cdrom linux.iso --availability ft \
--interfaces network0 --volumes 1024 \
--storage-group Pool-0001
Create a HA VM named vm001 with a CPU, 512 MB of memory, a 1,024 MB volume, and that is attached to network0. Then allocate storage from Pool-0001 for the volume. The volume is named vm001_vol0.
$ avcli vm-create --name vm001 --cpu 1 --memory 512 \
--cdrom linux.iso --availability ha \
--interfaces network0 --volumes 1024,Pool-0001,vm001_vol0
Create a FT VM named vm001 with a CPU and 512 MB of memory, and that is attached to network0 and network1. Create two volumes, where the first is 10 GB and the second is 50 GB. Allocate storage for these volumes from Pool-0001 and Pool-0002, respectively.
$ avcli vm-create --name vm001 --cpu 1 --memory 512 \
--cdrom linux.iso --availability ft \
--interfaces network0 network1 \
--volumes 10GB,Pool-0001 50GB,Pool-0002
Create a HA VM based on a kickstart template.
$ avcli vm-create --name vm001 --cpu 1 --memory 512 \
--boot-type bios --kickstart template:o81 \
--availability ha --interfaces network0 --volumes 10GB
Create a HA VM with a CPU, 1024 MB of memory, a 20 GB qcow2-format bootable volume named vm001_volu_boot, a 1,024 MB data volume named vm001_volu_data with 4096 B sector size, and that is attached to network0.
$ avcli vm-create --name vm001 --cpu 1 --memory 1024 \
--cdrom CentOS-7.7-x86_64-minimal.iso \
--availability ha --interfaces network0 \
--volumes 20GB,Pool-0001,vm001_volu_boot,qcow2 1024,Pool-0002,\
vm001_volu_data,qcow2,4096
Create the HA VM vm001 with a CPU, 2048 MB of memory, a 1,024 MB volume, and attached to network0 with MAC address 00:04:fc:40:60:55.
$ avcli vm-create --name vm001 --cpu 1 --memory 2048 \
--cdrom linux.iso --availability ha \
--interfaces network0,00:04:fc:40:60:55 --volumes 1024