User Tools

Site Tools


unix:virtualization:virtlib:quickreference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
unix:virtualization:virtlib:quickreference [2021/04/22 00:11] rodolicounix:virtualization:virtlib:quickreference [2021/11/19 23:20] rodolico
Line 14: Line 14:
   * **dommemstat //name//** - show allocated RAM   * **dommemstat //name//** - show allocated RAM
   * **domstats //name// | grep vcpu.current** - displays number of virtual cpu's assigned   * **domstats //name// | grep vcpu.current** - displays number of virtual cpu's assigned
 +  * **domblklist //name//** - show attached block devices
   * **start //name//** - starts the domain named **name** (name from list --all)   * **start //name//** - starts the domain named **name** (name from list --all)
   * **reboot //name//**   * **reboot //name//**
Line 26: Line 27:
     * detach-interface --domain pxe --type bridge --mac 52:54:00:47:2f:eb --config     * detach-interface --domain pxe --type bridge --mac 52:54:00:47:2f:eb --config
   * Remove virtual image (config file only)<code bash> virsh undefine domainname</code>   * Remove virtual image (config file only)<code bash> virsh undefine domainname</code>
 +  * **change-media //name// //drive//** - Insert or Eject a CDROM
 +    * change-media //name// //drive// --eject
 +    * change-media //name// //drive// //path/to/image// --insert
  
 ==== Remove a network from the entire system ==== ==== Remove a network from the entire system ====
Line 98: Line 102:
  
 ==== Problems shutting down with //virsh// ==== ==== Problems shutting down with //virsh// ====
-After installing the win-virtio package, you can use qemu-guest-agent to manage shutdown and reboot. This is much more reliable than using ACPI.+After installing the win-virtio package, you should see QEMU Guest Agent running as a service. With this running, you can use qemu-guest-agent to manage shutdown and reboot. This is much more reliable than using ACPI
 + 
 +**Important** Shut down the virtual before doing the following.
  
 Edit the guest Edit the guest
Line 114: Line 120:
 </code> </code>
  
-You will need to restart the virtual before the changes take effect. Once that is done, however, you can use the following commands much more reliably.+Start the virtual back up. Once that is done you can use the following commands much more reliably.
 <code bash> <code bash>
 virsh shutdown DOMAIN virsh shutdown DOMAIN
 virsh reboot DOMAIN virsh reboot DOMAIN
 </code> </code>
 +
 +This also allows you to execute //qemu-agent-command// from within //virsh//, but this is strongly discouraged unless you have researched what is going on. Any changes you make can cause instability in libvirt, since they are bypassing virsh. Kind of like using hdparm, where you can do Really Bad Things to your hard disk if you don't know for sure what you are doing. Do what you want, but be careful.
  
 ==== Windows servers will not restart ==== ==== Windows servers will not restart ====
Line 179: Line 187:
 virsh detach-interface domain --type bridge --mac ##:##:##:##:##:## --config virsh detach-interface domain --type bridge --mac ##:##:##:##:##:## --config
 # redefine it. Use values from above command, or change as needed # redefine it. Use values from above command, or change as needed
-virsh attach-interface domain --type bridge --source br_private --mac ##:##:##:##:##:## --model virtio --config+virsh attach-interface domain --type bridge --model virtio --source br_private --mac ##:##:##:##:##:## --model virtio --config
 </code> </code>
  
unix/virtualization/virtlib/quickreference.txt · Last modified: 2023/02/26 17:12 by rodolico