Create a VM

How to Create a VM

Create one or more virtual machines from the Virtual Machines page.

  1. Choose the option to create either one or multiple VM instances.
  2. The VM Name is a required field.
  3. The VM Template is optional. You can select ISO, raw, and Windows image templates as default options.
  4. Configure the CPU and Memory of the VM.
  5. Select SSH keys or upload new keys.
  6. Select a custom VM image on the Volumes tab. The default disk will be the root disk. You can add more disks to the VM.
  7. To configure networks, go to the Networks tab. The Management Network is added by default. It is also possible to add secondary networks to the VMs using VLAN networks. You may configure these on Advanced > Networks.
  8. Advanced options such as hostname and cloud-init data are optional. You may configure these in the Advanced Options section.

create-vm

create-vm

Cloud Configuration Examples

Password configuration for the default user:

  1. # cloud-config
  2. password: password
  3. chpasswd: { expire: False }
  4. ssh_pwauth: True

Network-data configuration using DHCP:

  1. version: 1
  2. config:
  3. - type: physical
  4. name: eth0
  5. subnets:
  6. - type: dhcp
  7. - type: physical
  8. name: eth1
  9. subnets:
  10. - type: dhcp

You can also use the Cloud Config Template feature to include a pre-defined cloud-init configuration for the VM.

Networks

Management Network

A management network represents the default VM eth0 interface configured by the cluster network solution that is present in each VM.

By default, a VM can be accessed via the management network.

Secondary Network

It is also possible to connect VMs using additional networks with Harvester’s built-in VLAN networks.