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:
- Check whether the namespace has sufficient resource quota:
oc describe resourcequota -n <your-namespace> - Verify that the disk image is available and the data volume has provisioned successfully:
oc get datavolume -n <your-namespace> - Check namespace events for errors, sorted by most recent:
oc get events -n <your-namespace> --sort-by='.lastTimestamp' - 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:
- Verify that the virtual machine is in a Running state:
oc get vmi -n <your-namespace> - Retrieve the virtual machine IP address:
oc get vmi <your-vm-name> -n <your-namespace> -o jsonpath='{.status.interfaces[0].ipAddress}' - Verify that the SSH service is running inside the virtual machine. Use the browser console to run:
sudo systemctl status sshd - Check the status of the
LoadBalancerservice:oc get svc -n <your-namespace>oc describe svc <your-ssh-vm> -n <your-namespace> - 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:
- Check CPU and memory utilization across pods in the namespace:
oc adm top pod -n <your-namespace> - Review virtual machine metrics in the Red Hat® OpenShift® console to identify resource bottlenecks.
- Check whether other virtual machines in the namespace are competing for the same CPU or memory resources.
- Verify storage performance by checking disk I/O metrics and persistent volume claim (PVC) health.
- 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:
- Verify the service configuration for the virtual machine:
oc get svc -n <your-namespace>oc describe svc <your-vm-service-name> -n <your-namespace> - 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.
- 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> - 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:
- Check disk usage from inside the virtual machine:
df -h - Review the status of persistent volume claims (PVCs) in your namespace:
oc get pvc -n <your-namespace> - Remove unnecessary files from inside the virtual machine to free disk space.
- If additional storage capacity is required, contact your cluster administrator. Storage expansion may not be available for all storage classes.
- 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.