def create_kvm_host(self): devicename = disk.create_lvm_volumegroup( self.hostname, int(self.property_list['\$total_disk_gb']) + 1, config.host(self.hostname).get_vol_group()) cmd = " virt-install" cmd += " -d --connect qemu:///system" cmd += " --name " + self.hostname cmd += " --ram " + self.ram cmd += " --vcpus=" + self.cpu if self.cpu_max is not None and self.cpu_max != "": cmd += ",maxvcpus=" + self.cpu_max cmd += " --vnc --noautoconsole" cmd += " --hvm" cmd += " --virt-type=kvm" cmd += " --autostart" cmd += " --disk path=" + devicename cmd += " --os-variant=rhel6" cmd += " --arch x86_64" if config.general.is_back_enabled(): cmd += " --network bridge:br0" cmd += " --network bridge:br1" cmd += " --location nfs:" + self.kvm_host_ip + ":/dvd" cmd += ' -x "ks=nfs:' + self.kvm_host_ip + ':/kickstart/' + self.hostname + '.ks' cmd += ' ksdevice=eth1' cmd += ' ip=' + config.host(self.hostname).get_front_ip() cmd += ' netmask=' + config.general.get_front_netmask() cmd += ' dns=' + config.general.get_front_resolver_ip() cmd += ' gateway=' + self.kvm_host_ip cmd += ' "' x(cmd) self.wait_for_installation_to_complete() self.autostart_guests()
def _install_guest(guest_name): ''' Create lvm vol and install guest with koan. ''' app.print_verbose("Install " + guest_name) # + 1 because it looks like the guest os needs a little bit more space # than it uses inside the guest. Could proably be optimized, and lowered # maybe just a few MB.. disk.create_lvm_volumegroup( guest_name, int(config.host(guest_name).get_total_disk_gb()) + 1, config.host(guest_name).get_vol_group()) x( "koan --server=" + config.general.get_installation_server_ip() + " --system=" + guest_name + " --virt -v --static-interface=eth1") x("virsh autostart " + guest_name)
def _install_guest(guest_name): ''' Create lvm vol and install guest with koan. ''' app.print_verbose("Install " + guest_name) devicename = disk.create_lvm_volumegroup(guest_name, config.host(guest_name).get_total_disk_gb()) x( "koan --server=" + config.general.get_installation_server_ip() + " --system=" + guest_name + " --virt -v --static-interface=eth0") x("virsh autostart " + guest_name)
def _install_guest(guest_name): ''' Create lvm vol and install guest with koan. ''' app.print_verbose("Install " + guest_name) devicename = disk.create_lvm_volumegroup( guest_name, config.host(guest_name).get_total_disk_gb()) x("koan --server=" + config.general.get_installation_server_ip() + " --system=" + guest_name + " --virt -v --static-interface=eth0") x("virsh autostart " + guest_name)