Skip to content

Migrate VM from Awanio CEP to Cockpit

Running migration via Vapor Web UI (without docker-compose)

You can set up and run the containerized migration utility directly from the Vapor Web UI without using Docker Compose command line tools.

1. Configure the Container

In the Vapor Web UI, navigate to the Docker tab, select Containers, and click + Create Container to open the creation drawer. Set the following options:

  • Name: kvirt2virt

  • Image: r.awan.app/library/tools/kvirt2virt:v1.0.4

  • Network: Change the network selection to host (this ensures the containerized libvirt tools can resolve local network domains and hypervisor socket interfaces).

  • Advanced Options:

    • Enable Privileged Mode (required to gain access to system virtualization and storage backends).
    • Enable Allocate Pseudo-TTY (-t) (required for interactive terminal prompts).
    • Enable Keep STDIN Open (-i) (required for interactive terminal prompts).
  • Volumes (Bind Mounts): Add the host paths to mount them inside the container (set the type to bind and propagation to rslave where applicable). Choose the source paths based on your Docker installation type:

    Option A: Standard Docker (e.g., Debian-based, RHEL, or official Docker CE)

    If your node uses a standard Docker daemon installed via native packages (e.g., apt-get install docker-ce on Debian), use direct host paths:

    1. Libvirt Socket: Source /var/run/libvirt ➔ Target /var/run/libvirt (Type bind, Propagation rslave)
    2. KubeVirt Pod Disk Storage: Source /var/lib/kubelet ➔ Target /var/lib/kubelet (Type bind, Propagation rslave)
    3. Local VM Images Pool: Source /var/lib/libvirt/images ➔ Target /var/lib/libvirt/images (Type bind, Propagation rslave)
    4. Host Kubeconfig Configuration: Source /root/.kube ➔ Target /root/.kube (Type bind)
    Option B: Snap-confined Docker (e.g., Ubuntu Snap installations)

    If your node uses Docker installed via Ubuntu Snap, the daemon runs in a confined mount namespace and cannot directly access /var/lib/kubelet or /var/run/libvirt. Follow these steps:

    1. On the host machine, run the following commands to create shared loop-back mounts:
      bash
      # Expose kubelet storage:
      sudo mkdir -p /var/snap/docker/common/kubelet
      sudo mount --bind /var/lib/kubelet /var/snap/docker/common/kubelet
      
      # Expose libvirt daemon socket:
      sudo mkdir -p /var/snap/docker/common/libvirt
      sudo mount --bind /var/run/libvirt /var/snap/docker/common/libvirt
      (To make these mounts persistent across reboots, add them to /etc/fstab)
    2. In the Vapor Web UI, set the volume fields using the exposed snap paths:
      1. Libvirt Socket: Source /var/snap/docker/common/libvirt ➔ Target /var/run/libvirt (Type bind, Propagation rslave)
      2. KubeVirt Pod Disk Storage: Source /var/snap/docker/common/kubelet ➔ Target /var/lib/kubelet (Type bind, Propagation rslave)
      3. Local VM Images Pool: Source /var/snap/docker/common/var/lib/libvirt/images ➔ Target /var/lib/libvirt/images (Type bind, Propagation rslave)
      4. Host Kubeconfig Configuration: Source /home/awanio/.kube ➔ Target /root/.kube (Type bind)

Click Create Container to spin up and run the container daemon in the background.

2. Execute Migration inside the Web Terminal

Once the container shows as running in the list:

  1. Click the container actions dropdown and select the Terminal action to open the Container Terminal Modal.
  2. Inside the web terminal, type and run:
    bash
    migrate -i
    This launches the interactive wizard where you can specify the target VMI, target name, storage pool, network, and/or copy-paste your kubeconfig setup.
  3. Alternatively, you can run the non-interactive command:
    bash
    migrate --vmi-name cirros-vm --namespace default --storage-pool default --target-name my-vm-copy

Output Modes

Default Mode

By default, the script runs in quiet mode, displaying only the VM details, real-time progress bars for copy/convert operations, and the final success status:

Migrating VM 'default/cirros-vm' to host VM 'my-cirros-copy'...
  Progress: [========================================] 100.0% (16MB / 16MB)
  Progress: [========================================] 100.0%
SUCCESS: VM 'my-cirros-copy' restored and is now running on host. (1.17s)

Verbose Mode

Run with the --verbose flag to output all diagnostic step logs, XML transformations, CPU model patching, and migration binary patches.