Provisioning virtual machines in Proxmox

You can create and manage virtual machines on Proxmox Virtual Environment by using orcharhino. Proxmox integrates the KVM hypervisor and Linux Containers (LXC).

orcharhino supports Proxmox 8 and 9.

Installing the Proxmox plugin

Install the Proxmox plugin to attach a Proxmox compute resource provider to orcharhino. This allows you to manage and deploy hosts to Proxmox.

Procedure
  • Install the Proxmox plugin on your orcharhino Server:

    $ orcharhino-installer --enable-foreman-plugin-proxmox
Verification
  1. In the orcharhino management UI, navigate to Administer > About.

  2. On the Available Providers tab, verify that the Proxmox provider is present.

Adding a Proxmox connection to orcharhino Server

Add Proxmox as a compute resource to provision and manage hosts on Proxmox. If your Proxmox instance consists of multiple nodes, you have to create a Proxmox connection to orcharhino for each node.

Prerequisites
  • Ensure that the host and network-based firewalls are configured to allow communication from orcharhino to Proxmox on TCP port 443.

  • Verify that orcharhino Server is able to resolve the host name of your Proxmox compute resource and Proxmox is able to resolve the host name of orcharhino Server.

Procedure
  1. In the orcharhino management UI, navigate to Infrastructure > Compute Resources.

  2. Click Create Compute Resource.

  3. In the Name field, enter a name for the compute resource.

  4. From the Provider list, select Proxmox.

  5. Optional: In the Description field, enter a description for the compute resource.

  6. Optional: In the Authentication method list, select User token if you do not want to use access tickets to authenticate on Proxmox.

  7. In the Url field, enter the IP address or host name of your Proxmox node. Ensure to specify its port and add /api2/json to its path.

  8. In the Username field, enter the user name to access Proxmox.

  9. In the Password field, enter the password for the user.

  10. Optional: Select the SSL verify peer checkbox to verify the certificate used for the encrypted connection from orcharhino to Proxmox.

  11. In the X509 Certificate Authorities field, enter a certificate authority or a correctly ordered chain of certificate authorities.

  12. Optional: Click Test Connection to verify the URL and its corresponding credentials.

  13. Click Submit to save the connection.

Adding Proxmox images to orcharhino by using orcharhino management UI

Proxmox uses templates as images for creating virtual machines. When you use image-based provisioning to create hosts, you must add Proxmox template details to your orcharhino.

Procedure
  1. In the orcharhino management UI, navigate to Infrastructure > Compute Resources.

  2. Select your Proxmox compute resource.

  3. Click Create Image.

  4. In the Name field, enter a name for the image.

  5. From the Operating System list, select the base operating system of the image.

  6. From the Architecture list, select the architecture of the operating system.

  7. In the Username and Password fields, enter the credentials to access the image over SSH.

  8. Select the User data checkbox if the image supports user data input, such as cloud-init data.

  9. From the Image list, select the name of the template in your Proxmox environment.

  10. Click Submit to add the image to orcharhino.

Adding Proxmox images to orcharhino by using Hammer CLI

Proxmox uses templates as images for creating virtual machines. When you use image-based provisioning to create hosts, you must add Proxmox template details to your orcharhino.

Procedure
  1. Optional: View all available images on Proxmox:

    $ hammer compute-resource image available --compute-resource "My_Proxmox"
  2. Add your Proxmox image to orcharhino:

    $ hammer compute-resource image create \
    --architecture "My_Architecture" \
    --compute-resource "My_Proxmox" \
    --name "My_Image_Name" \
    --operatingsystem "My_Operating_System" \
    --user-data true \
    --username My_User_Name \
    --uuid "My_UUID"
Verification
  • Verify that the Proxmox image is present on your orcharhino:

    $ hammer compute-resource image list --compute-resource "My_Proxmox"

Adding Proxmox details to a compute profile

You can predefine certain hardware settings for virtual machines on Proxmox. You achieve this through adding these hardware settings to a compute profile.

Note that this procedure assumes you are using KVM/qemu-based virtualization.

Procedure
  1. In the orcharhino management UI, navigate to Infrastructure > Compute Profiles.

  2. Select a compute profile.

  3. Select a Proxmox compute resource.

  4. From the Type list, select a virtualization option:

    • LXC container: Linux containers that focus on isolating applications and reusing the host kernel

    • KVM/Qemu server: Kernel-based virtual machines that run their own kernel and let you boot various guest operating systems

  5. Click the General tab.

  6. From the Node list, select a Proxmox node.

  7. From the Image list, select an image that is available on your Proxmox compute resource.

  8. From the Pool list, select a resource allocation pool.

  9. Optional: Click Advanced Options, Hardware, Network Interfaces, or Storage to configure compute profile settings.

  10. On the Storage tab, ATIX AG recommends to use either SCSI or VirtIO Block in the Controller field as the type of the disk controller of your host in Proxmox.

  11. On the Storage tab, ATIX AG does not recommend caching.

  12. Click Submit to save the compute profile.

Creating hosts on Proxmox by using orcharhino management UI

In orcharhino, you can use network or image-based provisioning to create hosts on Proxmox.

For network-based provisioning, you must create a host to access either orcharhino Server or orcharhino Proxy Servers on a Proxmox virtual network, so that the host has access to PXE provisioning services. The new host entry triggers the Proxmox to create the virtual machine. If the virtual machine detects the defined orcharhino Proxy through the virtual network, the virtual machine boots to PXE and begins to install the chosen operating system.

Prerequisites
  • For network-based provisioning, if you use a virtual network on the Proxmox server for provisioning, select a network that does not provide DHCP assignments. This causes DHCP conflicts with orcharhino Server when booting new hosts.

  • If you want to create a host over a network connection, the new host must be able to access your orcharhino Server or orcharhino Proxy Servers on a Proxmox virtual network, so that the host has access to PXE provisioning services. This new host entry triggers the Proxmox server to create and start a virtual machine. If the virtual machine detects the defined orcharhino Proxy Server through the virtual network, the virtual machine boots to PXE and begins to install the chosen operating system.

  • If you want to create a host with an existing image, the new host entry triggers the Proxmox server to create the virtual machine using a pre-existing image as a basis for the new volume.

  • Ensure that you have associated the Proxmox UserData provisioning template as User data template to your operating system entry.

Procedure
  1. In the orcharhino management UI, navigate to Hosts > Create Host.

  2. In the Name field, enter a name for the host.

  3. Optional: Click the Organization tab and change the organization context to match your requirement.

  4. Optional: Click the Location tab and change the location context to match your requirement.

  5. From the Host Group list, select a host group that you want to assign your host to. That host group will populate the form.

  6. From the Deploy on list, select the Proxmox connection.

  7. From the Compute Profile list, select a profile to use to automatically populate virtual machine settings. The Proxmox-specific fields are populated with settings from your compute profile. Modify these settings if required.

  8. If you have installed the Ansible Director plugin, and you want to configure your host through Ansible, from the Ansible Environment list, select your Ansible environment. The Ansible environment defines the lifecycle of the Ansible content and its Ansible Execution Environment.

  9. On the Ansible Director tab, click Assign content.

  10. From the list of Ansible collections, select Ansible roles, and click Confirm.

  11. Click the Interfaces tab, and on the interface of the host, click Edit.

  12. Verify that the fields are populated with values. Note in particular:

    • The Name from the Host tab becomes the DNS name.

    • Ensure that orcharhino automatically selects the Managed, Primary, and Provision options for the first interface on the host. If not, select them.

  13. Click OK to save. To add another interface, click Add Interface. You can select only one interface for Provision and Primary.

    For more information about network interfaces, see Configuring network interfaces in Managing Hosts.

  14. Click the Operating System tab, and confirm that all fields automatically contain values.

  15. Select the Provisioning Method that you want to use:

    • For network-based provisioning, click Network Based.

    • For image-based provisioning, click Image Based.

    • If the foreman_bootdisk plugin is installed, and you want to use boot disk-based provisioning, click Boot disk based.

  16. Click Resolve in Provisioning templates to check the new host can identify the right provisioning templates to use.

  17. Click the Virtual Machine tab and confirm that these settings are populated with details from the host group and compute profile. Modify these settings to suit your needs.

    You can set UEFI instead of legacy BIOS for your virtual machine:

    1. On the Advanced Options tab, set BIOS to OVMF (UEFI).

    2. On the Storage tab, click Add Efi Disk.

    To deploy virtual machines on Proxmox with UEFI Secure Boot enabled:

    1. On the Advanced Options tab, set BIOS to OVMF (UEFI Secure Boot).

    2. On the Storage tab, click Add Efi Disk. orcharhino will automatically enable pre-enrolled keys for your host.

  18. On the Parameters tab, click Add parameter. Add a parameter named kt_activation_keys, select the string type, and enter the name of the activation key as the value. The activation key has to belong to the same organization as your host. You can also enter a comma-separated list of multiple activation keys.

  19. Click Submit to save the host entry.

Deleting a virtual machine on Proxmox

You can delete virtual machines (VMs) running on Proxmox from within orcharhino.

By default, deleting a host entry associated with a virtual machine does not destroy the virtual machine on the compute resource.

To change the default behavior, navigate to Administer > Settings > Provisioning and set Destroy associated VM on host delete to Yes.

Procedure
  1. In the orcharhino management UI, navigate to Infrastructure > Compute Resources.

  2. Select your Proxmox provider.

  3. On the Virtual Machines tab, click Delete from the Actions menu. This deletes the virtual machine from the Proxmox compute resource while retaining any associated hosts within orcharhino. If you want to delete the orphaned host, navigate to Hosts > All Hosts and delete the host manually.

Importing a virtual machine from Proxmox into orcharhino

You can import existing virtual machines running on Proxmox into orcharhino.

Procedure
  1. In the orcharhino management UI, navigate to Infrastructure > Compute Resources.

  2. Select your Proxmox compute resource.

  3. On the Virtual Machines tab, click Import as managed Host or Import as unmanaged Host from the Actions menu. The following page looks identical to creating a host with the compute resource being already selected.

  4. Click Submit to import the virtual machine into orcharhino.

Adding a virtual console connection for a host on Proxmox

Configure orcharhino and Proxmox to access the virtual console of your host through orcharhino management UI.

Prerequisites
  • Your orcharhino Server has open ports for the virtual console.

  • Your host has the VGA output Standard VGA.

  • Your host has the type KVM/Qemu server.

Procedure
  1. On your Proxmox, open the required port for VNC.

    The port is the sum of 5900 and the VMID of your host. You can find the VMID of your host on Proxmox. For example, if your host has the VMID 142, open port 6042.

  2. On your Proxmox, enable VNC for your host in /etc/pve/nodes/My_Proxmox_Instance/qemu-server/My_VMID.conf:

    args: -vnc 0.0.0.0:_My_VMID_

    For more information, see VNC Client Access in the Proxmox documentation.

  3. Reboot your host on Proxmox.

  4. On your orcharhino Server, allow the websockify capability in SELinux:

    $ setsebool -P foreman_rails_can_connect_all on && setsebool -P websockify_can_connect_all on
  5. If you use a custom SSL certificate, import the SSL certificate from orcharhino Server into your browser. For more information, see Importing the Katello root CA certificate by using browser in Configuring authentication for orcharhino users.

    The remote console connection to your host will fail if you choose to temporarily accept not checking the certificates in your browser.

Next steps
  • You can now view the virtual console of your host in orcharhino management UI.

The text and illustrations on this page are licensed by ATIX AG under a Creative Commons Attribution Share Alike 4.0 International ("CC BY-SA 4.0") license. This page also contains text from the official Foreman documentation which uses the same license ("CC BY-SA 4.0").