Help Center/
Ubiquitous Cloud Native Service/
User Guide/
UCS Clusters/
On-Premises Clusters/
Managing an On-Premises Cluster/
Hybrid Management of VMs and Containers/
Managing VMs
Updated on 2025-04-27 GMT+08:00
Managing VMs
- Starting a VM
- Run the following virtctl command to start a VM:
virtctl start testvm
You will see the following output:VM testvm was scheduled to start
- Wait for several minutes and run the following kubectl command to check the VM status:
kubectl get vm
Example output:NAME AGE STATUS READY testvm 2h Running True
- Run the following virtctl command to start a VM:
- Listing VMs
You can list the VMs in all namespaces and their statuses, or only the VMs in a namespace.
- Run the following command to list the VMs in all namespaces:
kubectl get vm -A
Example output:NAMESPACE NAME AGE STATUS READY default testvm 82m Running True my-vm-pool vm-cirros 64s Running True
- Run the following command to list the VMs in a namespace:
kubectl get vm -n my-vm-pool
Example output:NAME AGE STATUS READY vm-cirros 2m14s Running True
- Run the following command to list the VMs in all namespaces:
- Viewing VM Information
- View basic VM information.
kubectl get vmi -n my-vm-pool
The output shows basic information such as the IP address assigned to the VM.NAME AGE PHASE IP NODENAME READY testvm 91m Running 172.16.51.103 192.168.88.99 True
- For more details, run the following ubectl describe commands:
kubectl describe vm/testvm kubectl describe vmi/testvm
- View basic VM information.
- Stoping a VM
Run the following command:
virtctl stop testvm
- Restarting a VM
Run the following command:
virtctl restart testvm
- Deleting a VM
Running the following command to delete a VM and its associated resources:
kubectl delete -f "https://kubevirt.io/labs/manifests/vm.yaml"
Example output:virtualmachine.kubevirt.io "testvm" deleted
Parent topic: Hybrid Management of VMs and Containers
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot