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/21 23:26] rodolicounix:virtualization:virtlib:quickreference [2021/06/26 16:09] 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 133: Line 141:
  
 I call this every 5 minutes from cron, thus, the max downtime will be 10 minutes, with an average of 5. I call this every 5 minutes from cron, thus, the max downtime will be 10 minutes, with an average of 5.
 +
 +**WARNING:** Remember this is running. If you need to take a virtual down for some reason, as long as this script is running, it will blindly go ahead and restart it.
  
 <code perl checkVirtuals> <code perl checkVirtuals>
unix/virtualization/virtlib/quickreference.txt · Last modified: 2023/02/26 17:12 by rodolico