Troubleshooting virtual machine service

Follow these troubleshooting tips for common issues and solutions for virtual machines provisioned with the virtual machine service.

Virtual machine does not start

Symptom: The virtual machine is stuck in a Starting or Provisioning state.

Solution:

  1. Check whether the namespace has sufficient resource quota:
    oc describe resourcequota -n <your-namespace>
  2. Verify that the disk image is available and the data volume has provisioned successfully:
    oc get datavolume -n <your-namespace>
  3. Check namespace events for errors, sorted by most recent:
    oc get events -n <your-namespace> --sort-by='.lastTimestamp'
  4. Review the logs of the virtual machine launcher pod. Replace virt-launcher-pod with the name of the launcher pod for your virtual machine:
    oc logs -n <your-namespace> <virt-launcher-pod>

Cannot connect to a virtual machine by using SSH

Symptom: SSH connection is refused or times out.

Solution:

  1. Verify that the virtual machine is in a Running state:
    oc get vmi -n <your-namespace>
  2. Retrieve the virtual machine IP address:
    oc get vmi <your-vm-name> -n <your-namespace> -o jsonpath='{.status.interfaces[0].ipAddress}'
  3. Verify that the SSH service is running inside the virtual machine. Use the browser console to run:
    sudo systemctl status sshd
  4. Check the status of the LoadBalancer service:
    oc get svc -n <your-namespace>
    oc describe svc <your-ssh-vm> -n <your-namespace>
  5. Verify that the SSH key was injected correctly by reviewing the cloud-init logs inside the virtual machine.

Virtual machine performance is degraded

Symptom: The virtual machine responds slowly or has high latency.

Solution:

  1. Check CPU and memory utilization across pods in the namespace:
    oc adm top pod -n <your-namespace>
  2. Review virtual machine metrics in the Red Hat® OpenShift® console to identify resource bottlenecks.
  3. Check whether other virtual machines in the namespace are competing for the same CPU or memory resources.
  4. Verify storage performance by checking disk I/O metrics and persistent volume claim (PVC) health.
  5. If utilization is consistently high, increase the CPU or memory allocation for the virtual machine.

Virtual machine networking problems

Symptom: Services on the virtual machine are unreachable, or DNS resolution fails.

Solution:

  1. Verify the service configuration for the virtual machine:
    oc get svc -n <your-namespace>
    oc describe svc <your-vm-service-name> -n <your-namespace>
  2. Confirm that the LoadBalancer service has an assigned external IP address. The EXTERNAL-IP column must not show <pending>:
    oc get svc -n <your-namespace>

    If the external IP address remains in a <pending> state, contact your cluster administrator to verify the MetalLB installation and IP address pool configuration.

  3. Test connectivity to the virtual machine service from within the cluster:
    oc run test-pod --image=busybox -it --rm -- wget -O- http://<your-vm-service-name>
  4. Check DNS resolution from inside the virtual machine by using the browser console.

Virtual machine storage issues

Symptom: The disk is full, or disk input/output performance is degraded.

Solution:

  1. Check disk usage from inside the virtual machine:
    df -h
  2. Review the status of persistent volume claims (PVCs) in your namespace:
    oc get pvc -n <your-namespace>
  3. Remove unnecessary files from inside the virtual machine to free disk space.
  4. If additional storage capacity is required, contact your cluster administrator. Storage expansion may not be available for all storage classes.
  5. If storage cannot be expanded, provision a new virtual machine with a larger disk size and migrate your workload.

Getting help

If the issue persists after following the steps in this topic, contact your cluster administrator with the following information:

  • The virtual machine name and namespace
  • A description of the issue
  • Steps to reproduce the issue
  • Relevant logs and error messages collected from the namespace

For additional guidance, see the Red Hat® OpenShift® Virtualization documentation.