6. Creating a virtual machineΒΆ

Note

For supported guest operating systems and other information, refer to Managing virtual machines.

To create a VM, do the following:

  1. On the Compute > Virtual machines > Virtual machines tab, click Create virtual machine. A window will open where you will need to specify the VM parameters.

    _images/compute_vms1_ac.png
  2. Specify a name for the new VM.

  3. Select the VM boot media:

    • If you have an ISO image or a template, do the following:

      1. Select Image in the Deploy from section, and then click Specify in the Image section.

      2. In the Images window, select the ISO image or template, and then click Done.

        _images/compute_vms2_ac.png
    • If you have a compute boot volume, do the following:

      1. Select Volume in the Deploy from section, and then click Specify in the Volumes section.

      2. In the Volumes window, click Attach.

      3. In the Attach volume window, find and select the volume, and then click Attach.

        _images/compute_vms3_ac.png

        If you attach more than one volume, the first attached volume becomes the boot volume, by default. To select another volume as bootable, place it first in the list by clicking the up arrow button next to it.

    After selecting the boot media, volumes required for this media to boot will be automatically added to the Volumes section.

  4. Configure the VM disks:

    1. In the Volumes window, make sure the default boot volume is large enough to accommodate the guest OS. Otherwise, click the ellipsis icon next to it, and then Edit. Change the volume size and click Save.
    2. (Optional) Add more disks to the VM by creating or attaching volumes. To do this, click the pencil icon in the Volumes section, and then Add or Attach in the Volumes window.
    3. Select volumes that will be removed during the VM deletion. To do this, click the pencil icon in the Volumes section, click the ellipsis icon next to the needed volume, and then Edit. Enable Delete on termination and click Save.
    4. When you finish configuring the VM disks, click Done.
  5. (Optional) If you have any placements, the Placement drop-down list is displayed. Placements are created by the administrator to group nodes or VMs sharing a distinctive feature, like a special license. Select the placement corresponding to the VM characteristics. For more information, refer to Managing placements.

  6. Choose the amount of RAM and CPU resources that will be allocated to the VM in the Flavor section. In the Flavor window, select a flavor, and then click Done.

    _images/compute_vms5_ac.png
  7. Add network interfaces to the VM in the Networks section:

    1. In the Networks interfaces window, click Add, select a compute network, and then click Add.

      _images/compute_vms6_ac.png

      A network interface connected to the selected network will appear in the Network interfaces list.

    2. (Optional) Edit additional parameters of newly added network interfaces, such as IP and MAC addresses and spoofing protection. To do this, click the ellipsis icon, click Edit, and then set the parameters. You will not be able to edit these parameters later. Instead, you will be able to delete the old network interface and replace it with a new one.

    3. When you finish configuring the VM network interfaces, click Done.

  8. (Optional) If you have chosen to boot from a template or volume, which has cloud-init and OpenSSH installed (refer to Preparing templates), do the following:

    Important

    As cloud images have no default password, you can access VMs deployed from them only by using the key authentication method with SSH.

    • Add an SSH key to the VM, to be able to access it via SSH without a password. In the Select an SSH key window, select an SSH key and then click Done.

      _images/compute_vms9_ac.png
    • Add user data to customize the VM after launch, for example, change a user password. Write a cloud-config or shell script in the Customization script field or browse a file on your local server to load the script from.

      _images/compute_vms10_ac.png

      To inject a script in a Windows VM, refer to the Cloudbase-Init documentation. For example, you can set a new password for the account using the following script:

      #ps1
      net user <username> <new_password>
      
  9. After configuring all of the VM parameters, click Deploy to create and boot the VM.

If you are deploying the VM from an ISO image, you need to install the guest OS inside the VM by using the built-in VNC console (refer to Connecting to virtual machines). Virtual machines created from a template or a boot volume already have a pre-installed guest OS.