vm¶
Manage virtual machines on the HVM host.
Commands¶
Command |
Description |
|---|---|
|
List VMs with name, power state, CPU, memory, and disk count |
|
Start a virtual machine |
|
Stop a virtual machine (graceful or forced) |
|
Restart a virtual machine |
|
Reboot a virtual machine |
vm list¶
List all virtual machines on the host with their current status.
sudo hvmcli vm list
VM Name Power State CPUs Memory(GB) Disks
---------- ----------- ---- ---------- -----
web-server running 4 8.0 2
db-server running 8 32.0 4
test-vm shut off 2 4.0 1
Use --details for extended information:
sudo hvmcli vm list --details
vm start¶
Start a stopped virtual machine.
sudo hvmcli vm start --name my-vm
Options:
--name <vm>— Name of the virtual machine to start (required)
vm stop¶
Stop a running virtual machine. By default performs a graceful ACPI shutdown.
sudo hvmcli vm stop --name my-vm
Force an immediate power-off (equivalent to pulling the power cord):
sudo hvmcli vm stop --name my-vm --force
Options:
--name <vm>— Name of the virtual machine to stop (required)--force— Force immediate power-off without graceful shutdown
Warning
Using --force may cause data loss or filesystem corruption if the guest OS has pending writes.
vm restart¶
Restart a virtual machine (stop then start).
sudo hvmcli vm restart --name my-vm
Options:
--name <vm>— Name of the virtual machine to restart (required)
vm reboot¶
Send a reboot signal to the virtual machine’s guest OS.
sudo hvmcli vm reboot --name my-vm
Options:
--name <vm>— Name of the virtual machine to reboot (required)