Deploying virtual machines to KVM

Last updated 11 April, 2019

About virtual machines

As a consumer, you can use HPE OneSphere to deploy resources that the administrator has curated for your assigned projects.

You can then deploy virtual machine instances from the project based on the images that are made available through the connected KVM environment.

For information about creating images from scratch and about obtaining prebuilt images, see Managing images and templates.

Deploying a virtual machine instance from HPE OneSphere to a KVM environment allows you to specify the project, zone, virtual machine profile (flavor), and network to connect to the virtual machine. You can optionally specify the contents of a cloud-init file and an SSH public key.

See also

Deploying a virtual machine to a KVM private cloud 

Virtual machines deployed from HPE OneSphere to a KVM environment contain the default block storage and contain the compute and memory resources that are defined in the selected image in the catalog.


The administrator:

  • Added a KVM private cloud zone to the HPE OneSphere portal using HPE OneSphere Connect.

    You can use the zone you added when initially connecting to HPE OneSphere, or you can use a private zone you added later. A maximum of 10 KVM servers are supported within one KVM private zone in HPE OneSphere.

    See Connecting to HPE OneSphere for the first time and Managing private cloud providers.

The administrator or project owner:

  • Added a project.

  • Assigned member(s) to a project.

  1. From the HPE OneSphere main menu, click Projects.

    (Administrator users can click Catalog, and skip steps 2, 3, and 4.)

  2. Click a project that you want to associate with the virtual machine deployment.
  3. On the Projects screen, click Deployments.

    Members of the selected project can view and manage the virtual machine after it is deployed.

  4. From the top right corner, click the plus sign  to the right of Deployments. The Catalog screen opens.
  5. Browse or search the catalog for images labeled KVM Images, or filter the results to show only KVM images. The image is the software that will be deployed on the virtual machine to create a virtual machine instance.


    HPE OneSphere automatically discovers KVM images in connected KVM servers. You can create KVM images using the OpenStack API, or by copying an existing image to /var/opt/hpe/imagelibrary/data/ on the KVM server where the Image Library role is enabled.

    See Network configuration for KVM servers for more information.

  6. Click the three dots in the lower right corner of the catalog item, then select Deploy
    If you selected the item, deselect it to see the three dots.
  7. On the Deploy panel:
    1. Enter a Name for the new virtual machine.


      Be sure to specify a unique name. HPE OneSphere does not prevent you from specifying a duplicate name if another virtual machine deployment is occurring at the same time.

      Do not specify restricted characters <>={}(),";& in the virtual machine name. These characters are used as dimension values in the HPE OneSphere monitoring service.

    2. From the Project drop-down menu, select the project where the virtual machine will be deployed.
    3. From the Zone drop-down menu, select a zone where the virtual machine will be deployed.
    4. From the Virtual Machine Profile drop-down, select the pre-defined flavor.
  8. Click Customize Deployment.
    1. Click the plus sign  to the right of Networks to display a drop-down list of networks previously assigned to the project by an administrator.

      For information about how to add networks to a project in a KVM private cloud, see "Creating images and networks for KVM servers using the OpenStack CLI" in Network configuration for KVM servers.

    2. Select the network and click Add. The selected network appears below the list of networks. You can add multiple networks based on your requirements.
    3. (Optional) Paste the contents of a cloud-init file into the text box.

      A cloud-init file allows you to customize the virtual machine instance with a hostname, default locale, and other details. For examples, see

    4. (Optional) Under SSH Public Key, click Choose File and browse to a file to upload, or paste a key into the text box.

      Public SSH keys are usually located at ~/.ssh/

      See Creating an SSH public key pair.

  9. Click Deploy.

    After the virtual machine is deployed, you can view the details of the created virtual machine in your project.

Updating cluster and server connections

For a specific zone, you can update the VMware ESXi cluster or KVM servers that are connected to the zone. In KVM zones, you can also enable services in the zone.


The administrator connected HPE OneSphere to a VMware ESXi or KVM private cloud.

  1. From the HPE OneSphere main menu, click Providers.
  2. Click Private Zones.
  3. From the list, click the zone that contains the cluster or server you want to update.
  4. Click the Update Zone link below the zone name to display the Update Zone panel with the list of available clusters and servers.
  5. From the Cluster Connection or Server Connection section, you can activate or deactivate the cluster or server.
    1. To activate all available clusters or servers, enable the Connect All Available Clusters or Connect All Available Servers toggle.
    2. To activate a single cluster or server, enable the toggle next to the cluster or server name. Multiple clusters or servers can be enabled at the same time.
    3. To deactivate all clusters or servers, disable the Connect All Available Clusters or Connect All Available Servers toggle.
    4. To deactivate a single cluster or server, disable the toggle next to the cluster or server name.
  6. (KVM private zones only) Enable services.

    To enable the Image library registry, select the server from the Image library registry drop-down list.

    To enable Block storage, select the server from the Block storage drop-down list. 


    By default Ceph (block storage) is enabled for the KVM hypervisor.  

    For more information, see Configuring Ceph storage.

  7. Click Update Zone.

Creating an SSH public key pair

Create a key pair and a security group to use SSH to log in to a virtual machine instance after it is deployed.


The default OpenStack security group does not allow SSH and ICMP access to a newly created guest virtual machine. You must create and assign a security group in order to access a deployed virtual machine instance. You can use the HPE OneSphere Private Cloud Control advanced console to manage security groups. 

See Configure access and security for instances in OpenStack Documentation.

  1. Create an SSH public key pair. From the command line of a workstation or PC accessible to the browser used to access HPE OneSphere, enter:
    ssh-keygen -t rsa -f cloud-key

    This command generates two files:

    • cloud-key, a private key you keep secret

    •, a public key you enter on the HPE OneSphere Virtual Machine panel

      You enter the public key when you deploy a virtual machine to the public cloud or private cloud.

  2. (Optional) Log in to the deployed virtual machine from the command line.
    ssh -i cloud-key username@vm-instance-ip-address

    You can also log in to the deployed virtual machine in HPE OneSphere. Under Projects, select a deployment, then click the Console icon.

    The console is launched if the proper routing and firewall rules are in place from the host to your local client.