# Virtual Machines

A virtual machine, or a VM, is a software-based representation of a physical computer. A VM allows you to run an operating system and applications using the resources of a host machine or a hypervisor, acting like a separate, isolated computer with its own virtual CPU, memory, storage, and network capabilities, all managed by the hypervisor.

You can create a virtual machine by first [populating an image in the image library](/private-cloud-director/images-and-image-library/image-library---images.md), then creating one or more VM flavors, and then creating a new VM.

## VM Flavors

Once you have the images you would like to use, it's time to look at the resource configuration for the VMs to be deployed. <code class="expression">space.vars.product\_name</code> uses T-shirt-sized configurations of resource allocations, called Flavors, to allow you to specify the resource allocation for VMs. Read more about [VM Flavors](/private-cloud-director/virtualized-clusters/virtualmachine/vm-flavors.md) here.

## VM Affinity and Anti-affinity Rules <a href="#server-groups" id="server-groups"></a>

<code class="expression">space.vars.product\_name</code> supports the creation of VM affinity and anti-affinity groups using a mechanism called Server Groups. Read more about [VM Affinity Anti-Affinity Rules](https://github.com/platform9/pcd-docs-gitbook/blob/main/private-cloud-director/2026.1/virtualmachine/vm-affinity-anti-affinity-rules.md) here.

## Create a VM

By now, you have your desired VM image, your preferred Flavor, and you have previously setup at least one Network that you can use to deploy your VM. So navigate to Virtual Machines in the Navigation pane and start 'Deploy Virtual Machine'.

We will describe some of the VM creation options here.

### VM source

{% hint style="warning" %}
**Warning**

This is an important selection that affects where your virtual machine disk is stored, and whether the VM will be using [Ephemeral Storage](/private-cloud-director/storage/ephemeral-storage.md) or [Block Storage](/private-cloud-director/storage/block-storage.md)
{% endhint %}

#### Boot VM from Image

Use this option to provision a VM that uses [Ephemeral Storage](/private-cloud-director/storage/ephemeral-storage.md) for its root disk. This storage option is typically used for non-production VMs where the disk need not be preserved across host failures or VM deletion. The VM root disk will be created using local storage on the hypervisor on which it is provisioned and populated with the contents of the source image. If the hypervisor were to go down, it would not be possible to access or recover the VM disk till the hypervisor comes back online. If the host's local disk experiences corruption or other issues, the VM may be impacted and may be unrecoverable. If the VM were to be deleted, the VM's root disk would be deleted along with it and would not be recoverable afterward.

#### Boot VM from New Volume

Use this option if you would like to create a VM that uses [Block Storage](/private-cloud-director/storage/block-storage.md) volume for its root disk. A VM created in this manner will persist across host failures and VM termination, unless you choose to delete the volume when the VM terminates. When you choose this option, a new persistent volume is created on the block storage you configured for your virtualized cluster, and its contents are populated from the source image.

#### Boot VM from Existing Volume

This option is like the previous one, except that you choose to boot from an existing volume rather than provisioning a new volume from a base image.

#### Install OS from ISO Wizard

You can now create Windows and Linux VMs directly from installation ISOs through the **Deploy New VM** wizard in the UI. This replaces the previous CLI-only workflow documented in the [Windows](/private-cloud-director/tutorials/create-windows-vm-from-iso/creating-a-windows-virtual-machine--vm--from-an-iso-image4io.md) and [Ubuntu](/private-cloud-director/tutorials/deploy-a-virtual-machine-using-an-ubuntu-iso-image.md) tutorials.

**To install an OS from an ISO:**

1. In the **Deploy New VM** wizard, select **Install from ISO** from the **Boot VM From** dropdown.
2. Select an installation ISO from your image library and set the **Root Volume Size**. A new volume of the specified size will be created for the OS installation.
3. (Optional) For Windows installs, enable **Drivers ISO** and select the VirtIO drivers ISO for optimal performance.
4. Complete the remaining steps (optionally attach additional volumes, select a flavor, configure networking, customize VM) and click **Deploy Virtual Machine**.
5. Connect to the VM console and complete the OS installation. The VM is configured with a boot order of boot volume first, then ISO, so once the OS installer finishes and the VM reboots, it will automatically boot from the installed disk.

**Notes:**

* Only zero-disk flavors are supported, since the root disk is provided by the volume created in step 2. The VM disk size will equal the volume size.
* Bulk VM creation is not supported when installing from an ISO.
* The installation ISO can remain attached to the VM after installation. It will not interfere with boot because of the boot order, and it remains in the image library. You can detach it manually if you prefer.

#### Guest OS hostname

By default, the value you enter in the **Name** field is used both as the VM's display name in Private Cloud Director and as the guest OS hostname. To set a hostname that differs from the VM name, use the **Guest OS Hostname (Optional)** field in the **Basic VM Info** section. This is useful when you want a descriptive VM name for tracking and reporting, paired with a shorter, standards-compliant hostname inside the OS.

If you leave the **Guest OS Hostname (Optional)** empty, the **VM** **Name** is used as the guest OS hostname.

When you deploy more than one VM in a single operation, Private Cloud Director appends a numeric suffix to the hostname so that each VM has a unique name, using the same pattern as VM names.

If you set a value in **Guest OS Hostname (Optional)** and also include a cloud-init script that sets the hostname, the cloud-init script takes precedence. Use only one method to set the hostname to avoid unexpected behavior.

### SSH Key

Using SSH Keys is the recommended and secure method to access your VMs. To set up your SSH Key, navigate to 'Networks and Security' in the Navigation Pane, and import your SSH Keys.

Once you have the key imported, you can select that key when creating a new VM.

### Select Server Group

Optionally select an [affinity or anti-affinity group](#vm-affinity-and-anti-affinity-rules) for this VM to be part of. This will impact the VM's placement on a host in your virtualized cluster.

### Using cloud-init

Using cloud-init allows you to customize the virtual machine as it boots, such as provisioning additional software or custom scripts.

### Assign Security Groups

Security groups allow you to limit port access to Virtual Machines. If you don't already have a Security Group configured, you can cover this later.

### Specify Metadata

Metadata attributes allow you to specify additional key-value pairs, which can be used to query and organize your virtual machines.

{% hint style="success" %}
**Success**

With this information specified, you should see the VM provision within a few minutes. You can then access the VM over the network or via its console.
{% endhint %}

## VM Properties

### VM UUID

Each newly created virtual machine is assigned a unique UUID. By default, this field is not displayed in the virtual machines grid view in the UI. You can change this by clicking the 'Manage Columns' button above the virtual machines grid view and selecting the UUID field. You can also select an individual VM to open the VM details view and see the ID property listed there. Alternatively, you can get VM ID using the pcdctl CLI by running the `pcdctl server list` command or the `pcdctl server show` command and supplying the name of the VM.

## Migrate Existing VMs from VMware

If you have existing workloads that you would like to migrate onto your <code class="expression">space.vars.product\_name</code> cluster, [Project vJailbreak](https://github.com/platform9/vjailbreak) can help.

### Download the vJailbreak Appliance

Head over to Project vJailbreak to download the appliance image. The appliance is packaged as an OVA that you can deploy into your <code class="expression">space.vars.product\_name</code> environment. Note that vJailbreak should have access to your storage network to efficiently migrate VM data over during the data copy phase.

### Register your Source VMware Environment and Your New Virtualized Cluster

As your vJailbreak appliance loads, you'll see instructions for accessing its user interface, where you can specify your source VMware environment information, as well as the information for your new cluster.

### Select VMs and Schedule Migrations

With this information specified, you can now initiate migrations from the vJailbreak user interface.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/private-cloud-director/virtualized-clusters/virtualmachine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
