====== Virtualization ====== ====== tbd ====== * http://www-01.ibm.com/support/knowledgecenter/linuxonibm/liaat/liaatsecstorotherdir.htm If you want to change the default storage pool location, I don't know of other ways than manually editing /etc/libvirtd/storage/defauls.xml (shutdown libvirtd first and start it after) or linking the images directory to ====== Libvirtd Image Location ====== * https://ask.fedoraproject.org/en/question/9584/while-using-libvirt-how-can-i-use-a-location-other-than-varliblibvirtimages-to-store-my-images/ * ====== Managing qemu VMs ====== ===== Using virt-manager ===== ===== - Using virsh ===== Image Location: ls /var/lib/libvirt/ boot/ dnsmasq/ filesystems/ images/ libxl/ lxc/ network/ qemu/ uml/ xen/ Restart libvirtd after manually delete image etc. service libvirtd stop [dang@dai142 devstack-nodes]$ virsh -c qemu:///system list Id Name State ---------------------------------------------------- 21 devstack-nodes_devstack-control running [dang@dai142 devstack-nodes]$ virsh -c qemu:///system Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # list Id Name State ---------------------------------------------------- 21 devstack-nodes_devstack-control running virsh # exit ==== Save state of nested VMs ==== Save a running VM Guest with the command virsh save and specify the file to where it is saved. Save the guest named opensuse11 virsh save opensuse11 /virtual/saves/opensuse11.vmsav Save the guest with the ID 37 virsh save 37 /virtual/saves/opensuse11.vmsave To restore it, use virsh restore: virsh restore /virtual/saves/opensuse11.vmsave ==== Troubleshooting vms ==== * https://fedoraproject.org/wiki/How_to_debug_Virtualization_problems * https://unix.stackexchange.com/questions/33191/how-to-find-the-ip-address-of-a-kvm-virtual-machine-that-i-can-ssh-into-it * https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/virtualization/chap-virtualization-managing_guests_with_virsh * https://serverfault.com/questions/627238/kvm-libvirt-how-to-configure-static-guest-ip-addresses-on-the-virtualisation-ho virsh list virsh net-list virsh net-list --all brctl show sysctl net.bridge.bridge-nf-call-iptables iptables -L -v -n ps -ef | grep dnsmasq ifconfig -a cat /proc/sys/net/ipv4/ip_forward service libvirtd reload ====== Nested Virtualization with kvm intel ====== * http://kashyapc.com/2012/01/14/nested-virtualization-with-kvm-intel/ Let us first ensure kvm_intel kernel module has nesting enabled. By default, it’s disabled for Intel arch[ but enabled for AMD -- SVM (secure virtual machine) extensions arch.] modinfo kvm_intel | grep -i nested parm: nested:bool # Enable nested virtualization echo "options kvm-intel nested=1" | sudo tee /etc/modprobe.d/kvm-intel.conf OR add boot option cat /etc/default/grub | grep CMDLINE GRUB_CMDLINE_LINUX="rd.lvm.lv=vol0/swapVol rd.md=0 rd.dm=0 KEYTABLE=us quiet rd.lvm.lv=vol0/rootVol rhgb rd.luks=0 SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 kvm-intel.nested=1" Verify cat /sys/module/kvm_intel/parameters/nested Y systool -m kvm_intel -v | grep -i nested nested = "Y" # ===== Enable Nested Virtualization Guest ===== The o/p of the above cmd has a variety of options. Since we need only vmx extensions, I tried the simple way by adding to the regular-guest’s libvirt xml(virsh edit ..) and started it. core2duo ===== Start Guest with qemu-kvm ===== ps -ef | grep -i qemu-kvm | egrep -i 'regular-guest-f18|vmx' qemu 15768 1 19 13:33 ? 01:01:52 /usr/bin/qemu-kvm -name regular-guest-f18 -S -M pc-1.3 -cpu core2duo,+vmx -enable-kvm -m 4096 -smp 4,sockets=4,cores=1,threads=1 -uuid 9a7fd95b-7b4c-743b-90de-fa186bb5c85f -nographic -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/regular-guest-f18.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/export/vmimgs/regular-guest-f18.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=26 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:a6:ff:96,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 ===== - Paravirtualization ===== ==== Xen ==== * https://wiki.xenproject.org/wiki/Xen_Project_Beginners_Guide ====== Libvirt ====== * https://doc.opensuse.org/documentation/leap/virtualization/html/book.virt/part.virt.libvirt.html