UCloud logo UCloud logo UCloud
v2026.3.0
  1. UCloud/Core
  2. 1. Introduction
  3. 2. Projects
  4. 3. Accounting
  5. 4. Orchestration
  6. UCloud/IM for Slurm-based HPC
  7. 5. Installation
  8. 6. Architecture and Networking
  9. 7. User and Project Management
  10. 8. Filesystem Integration
    1. 8.1. Inter-provider file transfers
  11. 9. Slurm Integration
    1. 9.1. Application Management
    2. 9.2. Built-in Applications
  12. 10. Reference
    1. 10.1. Configuration
    2. 10.2. CLI
  13. 11. Appendix
    1. 11.1. Built-in Application Index
  14. UCloud/IM for Kubernetes
  15. 12. Installation
  16. 13. Architecture and Networking
  17. 14. Filesystem Integration
  18. 15. Compute Jobs
    1. 15.1. Public Links
    2. 15.2. Public IPs
    3. 15.3. License Servers
    4. 15.4. SSH Servers
    5. 15.5. Job Audit Log
    6. 15.6. Virtual machines
  19. 16. Integrated applications
    1. 16.1. Syncthing
    2. 16.2. Integrated terminal
  20. 17. UCX applications
    1. 17.1. Hello world
    2. 17.2. Data binding
    3. 17.3. UI events
    4. 17.4. Component reference
    5. 17.5. API reference
  21. 18. Reference
    1. 18.1. Configuration
    2. 18.2. CLI
  22. Frontend development
  23. 19. Frontend description and development guidelines
  24. Branding for UCloud
  25. 20. Branding and identity for UCloud
  26. H: Procedures
  27. 21. H: Procedures
  28. 22. H: Introduction
  29. 23. H: Auditing
  30. 24. H: Auditing scenario
  31. 25. H: GitHub actions
  32. 26. H: Deployment
  33. 27. H: 3rd party dependencies (risk assesment)
  1. Links
  2. Source Code
  3. Releases

Virtual Machines

This chapter describes how UCloud/IM for Kubernetes uses KubeVirt to run full virtual machines. VM support is enabled in the Kubernetes configuration and is further controlled per machine group through allowVirtualMachines.

Overview

Each VM job is tracked as a normal UCloud job, but the integration module creates and manages a VirtualMachine in Kubernetes instead of a container-based workload. The VM is named vm-<job-id>-0 and is currently limited to rank 0.

The integration module also creates the supporting Kubernetes resources needed for the job, including:

  • a VirtualMachine
  • a persistent disk for the VM image
  • a network policy for the VM traffic
  • services for SSH, public IPs, or internal job access when requested

Storage

VM disks are prepared from the application image, converted to a raw disk image, and resized to the requested disk size. The disk backend is controlled by the Kubernetes VM storage configuration:

  • HostPath stores the disk on a local host path prefix
  • CsiStaticPv creates a static PV/PVC pair through the configured CSI driver

User files are mounted into the VM through virtiofs. The integration module stores the VM-specific configuration under Jobs/VirtualMachines/<job-id> inside the provider file system.

Guest setup

KubeVirt VMs boot with cloud-init configuration generated by the integration module. This sets up:

  • a ucloud user with sudo access
  • the VM agent service
  • the metrics service
  • network configuration suitable for DHCP inside the guest

The VM agent is what allows the provider to manage shell access, VNC sessions, SSH key updates, and job state reporting.

Access

Interactive access is available through the same job/session mechanisms as the rest of UCloud/IM:

  • shell sessions first try the VM agent and fall back to the serial console if needed
  • VNC sessions are proxied through KubeVirt’s VNC stream
  • web sessions use the normal ingress-based flow when the job exposes web services

VM Agent

Each VM runs a small agent service that connects back to the integration module using a job-specific token. After the agent authenticates, the provider returns a second token used for server-to-agent communication.

The agent is responsible for:

  • keeping the VM session alive with heartbeat messages
  • receiving updated SSH keys for the job owner
  • accepting TTY requests for interactive shell sessions
  • helping the provider route shell traffic to the right VM session

This is the path used by the normal shell experience. If the agent is unavailable, the integration module can fall back to the KubeVirt serial console.

Metrics Service

The VM also runs a metrics service alongside the agent. It writes VM statistics into the job’s logs directory, where the integration module can read them back and forward them to the normal job-follow stream.

The service exists to provide runtime telemetry from inside the guest, including utilization data that is emitted while the VM is running. These metrics are stored under the job’s logs folder together with the other VM log output.

Lifecycle

When a VM job is started, the integration module creates or updates the KubeVirt resources to match the job configuration. Suspending a job stops the VM, and terminating a job deletes the VM and cleans up the disk data.

VMs are not available for sensitive projects, and jobs with more than one rank are rejected.

Configuration

See the Kubernetes configuration reference for the full VM-related configuration, including storage settings and machine-group permissions.

Previous Job Audit Log
Next Integrated applications