Guest Editing SOP
Various virsh commands
Contact Information
- Owner
-
Fedora Infrastructure Team
- Contact
-
#admin, sysadmin-main
- Location
-
all
- Servers
-
kvm/libvirt servers.
- Purpose
-
Various virsh commands for vm’s
How to do it
Add cpu
-
SSH to the virthost server
-
Calculate the number of CPUs the system needs
-
sudo virsh setvcpus <guest> <num_of_cpus> --config- ie:sudo virsh setvcpus bapp01 16 --config
-
Shutdown the virtual system
-
Start the virtual system
Note that using virsh reboot is insufficient. You have to actually stop the domain and start it with
virsh destroy <guest>andvirsh start <guest>for the change to take effect. -
Login and check that cpu count matches
-
Remember to update the group_vars in ansible to match the new value you set, if appropriate.
Resize memory
-
SSH to the virthost server
-
Calculate the amount of memory the system needs in kb
-
sudo virsh setmem <guest> <num_in_kilobytes> --config- ie:sudo virsh setmem bapp01 16777216 --config
-
Shutdown the virtual system
-
Start the virtual system
Note that using virsh reboot is insufficient. You have to actually stop the domain and start it with
virsh destroy <guest>andvirsh start <guest>for the change to take effect. -
Login and check that memory matches
-
Remember to update the group_vars in ansible to match the new value you set, if appropriate.
Chaining commands with console
When shutting down instances to edit them you can use virsh console to wait until the guest is fully shutdown:
-
virsh shutdown guestfqdn; virsh console guestfqdn; virsh edit guestfqdn; virsh start guestfqdn
Want to help? Learn how to contribute to Fedora Docs ›