Virtual Machine Orchestration
Cockpit provides a centralized management console to orchestrate the lifecycle of virtual machines (VMs) running across physical Vapor hosts. Administrators can monitor performance, provision new workloads, manage virtual device attachments, execute power actions, and coordinate backup policies from a single control pane.
1. Centralized VM Inventory
Cockpit consolidates virtual machines across all connected Vapor hosts into a single inventory.
Key Features
- Unified Inventory: View, search, and organize virtual machines into logical groupings regardless of the physical host they reside on.
- Resource and Metrics Panel: Displays real-time charts of CPU utilization, memory allocation, network traffic (IP/MAC addresses), and disk read/write throughput.
- Console Access: Open direct interactive console sessions (VNC or SPICE protocol) in the web browser. This acts as a virtual monitor and keyboard for direct operating system access and troubleshooting.
2. Virtual Machine Provisioning Wizard
The virtual machine creation wizard guides administrators through the configuration steps required to provision virtualized workloads.
Wizard Configuration Steps
- Creation Type: Select the provisioning mode:
- Create New VM: Instantiates a VM from scratch.
- Clone an Existing VM: Duplicates an active or stopped VM.
- Clone a VM to Template: Creates a template from a VM snapshot.
- Convert VM to Template: Destructively converts a VM configuration into a reusable template.
- Placement Target: Specify the target datacenter and physical Vapor host. Cockpit displays resource capacities (free CPU and RAM) to assist with scheduling.
- Identity and OS: Set the VM hostname and target OS variant (e.g.,
ubuntu20.04,generic) to optimize libvirt driver presets. - Storage Allocation: Define the virtual disks. Supported actions include:
- Create qcow2 disk: Allocate a virtual disk file with a defined size (in GB) on a specific storage pool/datastore.
- Direct mapping: Attach a direct raw host block device or direct DRM host device mapping (raw format, virtio/SATA bus).
- Network Assignment: Configure virtual network interfaces (NICs). Administrators specify the interface type (
networkorbridge), source virtual switch (standard bridge or cluster-level distributed network), and driver model (e.g.,virtio). - Advanced Hardware: Customize advanced parameters such as CPU topology, firmware (BIOS/UEFI), boot order, and PCI device passthrough.
- Cloud-Init: Inject cloud-init metadata and userdata scripts (e.g., root passwords, SSH authorized keys, shell commands) for automatic post-boot provisioning.
- Review and Create: Verify the configuration schema and dispatch the asynchronous create request to the target hypervisor host.
3. Lifecycle and Power Operations
Cockpit supports the following runtime power state transitions:
- Power On: Initiates the VM and boots the guest operating system.
- Pause: Suspends execution, freezing the VM's active CPU and memory state in place.
- Resume: Restores CPU execution and memory state for a paused VM.
- Power Off (Graceful): Sends an ACPI shutdown signal to the guest operating system, requesting a graceful halt.
- Power Off (Hard): Executes an immediate hard shutdown (similar to disconnecting power), terminating the libvirt process.
4. Hardware and Spec Modification
Administrators can edit the hardware settings of offline or online VMs:
- Resource Upgrades: Modify allocated CPU cores (vCPUs) and RAM capacity (in MB).
- Device Management:
- Hard Disks: Attach or detach virtual disks dynamically. New virtual disks can be provisioned, and direct raw device paths can be attached or detoured.
- Network Adapters: Add or remove network interface cards.
- PCI Device Passthrough: Map host PCI devices (e.g., GPUs, network controllers) directly to the VM for dedicated access.
- Advanced Parameters: Edit advanced settings (such as metadata values or performance tuning properties) in an editable table interface.
5. Cloning and Template Management
Templates and cloning enable standardizing VM configurations and rapid provisioning.
- VM Cloning: Creates an independent copy of a source VM's configuration and virtual disks. The clone wizard prompts for the source VM name, the new VM name, and the target datastore for disk duplication.
- Clone VM to Template: Copies a source VM and registers it as a read-only template in the VMs and Templates inventory.
- Convert VM to Template: Permanently changes a VM into a template. This is a configuration status transition that marks the VM metadata as a template.
- Convert Template to VM: Reverts a template back into an independent virtual machine, restoring normal power cycle and configuration edit operations.
6. Deletion and Cleanup Options
When deleting a virtual machine, Cockpit exposes options to manage underlying resources:
- Metadata Deletion: Removes the VM registration from Cockpit and the host hypervisor configuration.
- Storage Cleanup: By default, deleting a VM keeps its virtual disks to prevent data loss. Administrators can toggle the
remove_disksparameter (executing API DELETE/vms/:id?remove_disks=true) to delete all associated virtual disk volumes from their respective datastores.