Quick cookbook to install and configure Redhat Virtualization Manager (RHEV-M) and install virtual machines....
Description
Red Hat Enterprise Virtualization,RHEV,RHCVA *********************************************
Install and configure RHEV-M ============================ yum update -y reboot yum install rhevm rhevm-reports -y rhevm-setup rhevm-dwh-reports rhevm-reports-setup NB: Reboot is required only if a new kernel is installed by yum update -y Join domain =========== rhevm-manage-domains -action=add -domain=example.com -user=domainuser -provider= IPA -interactive To see all available parameters, simply run rhevm-manage-domains. For instance you will see the supported providers are IPA,RHDS (Red Hat Directory Services) and ActiveDirectory. Set Mac Address =============== rhevm-config -a | grep -i mac rhevm-config -g MacPoolRanges MacPoolRanges: 00:1A:4A:18:04:00-00:1A:4A:18:04:FF version: general [root@rhevm ~]# rhevm-config -s MacPoolRanges=52:54:00:56:04.01-52:54:00:56:04.6 3 [root@rhevm ~]# rhevm-config -g MacPoolRanges MacPoolRanges: 52:54:00:56:04.01-52:54:00:56:04.63 version: general 52:54:00 -> man virt-install
Upload ISOs to ISO domain ========================
Linux VM template, Sealing Procedure ==================================== 1. Log in to the virtual machine. Flag the system for re-configuration by runnin g the following command as root: # touch /.unconfigured man sys-unconfig 2. Remove ssh host keys. Run: # rm -rf /etc/ssh/ssh_host_* 3. Set HOSTNAME=localhost.localdomain in /etc/sysconfig/network 4. Remove /etc/udev/rules.d/70-*. Run: # rm -rf /etc/udev/rules.d/70-* 5. Remove the HWADDR= line from /etc/sysconfig/network-scripts/ifcfg-eth*. 6. Optionally delete all the logs from /var/log and build logs from /root. 7. Shut down the virtual machine. Run: # poweroff Another method to clear system specific information
=================================================== yum install libguestfs-tools -y virt-sysprep –list virt-sysprep -a diskimage clears all in the list by default
firstboot method to reconfigure Linux ===================================== yum install -y firstboot chkconfig firstboot on cat /etc/sysconfig/firstboot RUN_FIRSTBOOT=NO Change it YES touch /etc/reconfigSys Exporting and editing disk images =================================== Export a VM guestfish -i -w -a /path/to/diskimage
Create, kill VM from command line =================================
Kill VM by process ID ===================== [root@desktop9 ~]# ps aux | grep rhevm qemu 19809 40.7 8.0 4947312 642908 ? Sl 08:28 0:10 /usr/libexec/qe mu-kvm -S -M rhel6.3.0 -enable-kvm -m 4096 -smp 2,sockets=2,cores=1,threads=1 -n ame rhevm -uuid 326d6930-0126-673b-06d4-01490eda643e .....
virsh # list Id Name State ---------------------------------------------------9 rhevm running virsh # shutdown rhevm Domain rhevm is being shutdown virsh # list Id Name State ---------------------------------------------------9 rhevm running
Note: "destroy VMname" for force poweroff
Create VM ========= virt-install --name mykvm --ram 1024 --disk path=/var/lib/libvirt/images/mykvm,s ize=4 --cdrom rhel-server-6.3-x86_64-dvd.iso man virt-install
Thank you for interesting in our services. We are a non-profit group that run this website to share documents. We need your help to maintenance this website.