libvirt usefull commands – Part 1

In each part will present 5 usefull libvirt commands that are not very popular.

  • Increase memory
  • Attach an extra disk
  • Extra network interface
  • Take screenshot
  • Change vCPU number

 

Increase memory

virsh setmaxmem <vm_name> 1024M --config && virsh setmem <vm_name> 1024M --config

 

Attach an extra disk

virsh attach-disk gluster01 /dev/raid_0/gluster01_brick1 vdb --cache none --config 

 

Extra network interface

virsh attach-interface --domain <vm_name> --type network --source <network> --model virtio --mac 12:23:34:45:56:67 --config

 

Take screenshot

virsh screenshot <vm_name>

 

Change vCPU number

virsh setvcpus <vm_name> 4 --config

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s