Skip to content

Common Tasks

Getting Cluster Access

Download a kubeconfig from the Palette UI:

  1. Navigate to the cluster in Palette.
  2. Click Download Kubeconfig.
  3. Set the KUBECONFIG environment variable:

```bash copy export KUBECONFIG=~/Downloads/admin.edge-vmo.kubeconfig

!!! warning "Token Expiry"
    Palette proxy kubeconfigs use tokens that expire regularly. Download a fresh kubeconfig if you get authentication errors.

---

## VM Lifecycle

### Start a VM

```bash copy
virtctl start <vm-name> -n virtual-machines

Stop a VM

```bash copy virtctl stop -n virtual-machines

### Restart a VM

```bash copy
virtctl restart <vm-name> -n virtual-machines

Pause a VM

```bash copy virtctl pause vm -n virtual-machines

### Unpause a VM

```bash copy
virtctl unpause vm <vm-name> -n virtual-machines


Console Access

Serial Console

```bash copy virtctl console -n virtual-machines

!!! tip
    Press `Ctrl+]` to disconnect from the serial console.

### Graphical Console (VNC)

```bash copy
virtctl vnc <vm-name> -n virtual-machines

SSH Access

```bash copy virtctl ssh @ -n virtual-machines

---

## Hotplug Disk

Attach additional storage to a running VM without restarting:

1. Create a PVC:

    ```yaml
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: extra-disk
      namespace: virtual-machines
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 20Gi
      storageClassName: portworx-block
    ```

2. Hotplug it to the running VM:

    ```bash copy
    virtctl addvolume <vm-name> --volume-name=extra-disk -n virtual-machines
    ```

3. To remove a hotplugged disk:

    ```bash copy
    virtctl removevolume <vm-name> --volume-name=extra-disk -n virtual-machines
    ```

---

## Check VM Health

List all running VM instances with node placement and IPs:

```bash copy
kubectl get vmi -n virtual-machines -o wide

Check VM conditions and detailed status:

```bash copy kubectl get vm -n virtual-machines -o yaml

---

## Check Outdated Launchers

After a KubeVirt upgrade, check for VMs still running with old `virt-launcher` images:

```bash copy
kubectl get vmi -l kubevirt.io/outdatedLauncherImage --all-namespaces

Info

VMs with outdated launchers need a virtctl restart to pick up the new version. Live migration will fail with version skew errors.


Golden Images

Golden images are stored as PVCs in the vmo-golden-images namespace. They are used as clone sources in dataVolumeTemplates when creating new VMs.

List available golden images:

```bash copy kubectl get pvc -n vmo-golden-images

Example `dataVolumeTemplate` referencing a golden image:

```yaml
dataVolumeTemplates:
  - metadata:
      name: my-vm-rootdisk
    spec:
      source:
        pvc:
          namespace: vmo-golden-images
          name: ubuntu-22.04-golden
      pvc:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 50Gi
        storageClassName: portworx-block


Portworx Status

Check overall Portworx cluster health and available storage:

```bash copy PX_POD=$(kubectl get pods -l name=portworx -n portworx -o jsonpath='{.items[0].metadata.name}') && \ kubectl exec $PX_POD -n portworx -- /opt/pwx/bin/pxctl status

List Portworx volumes:

```bash copy
PX_POD=$(kubectl get pods -l name=portworx -n portworx -o jsonpath='{.items[0].metadata.name}') && \
kubectl exec $PX_POD -n portworx -- /opt/pwx/bin/pxctl volume list

Inspect a specific volume:

bash copy PX_POD=$(kubectl get pods -l name=portworx -n portworx -o jsonpath='{.items[0].metadata.name}') && \ kubectl exec $PX_POD -n portworx -- /opt/pwx/bin/pxctl volume inspect <volume-id>