[virt-tools-list] About virt-install 0.6
Cole Robinson
crobinso at redhat.com
Fri Jan 13 01:09:39 UTC 2012
On 12/25/2011 08:58 PM, gong ys wrote:
> Dear virt-install developers:
>
> I found one of my commands can run on virt-install 0.5x, but it fails on
> virt-install 0.6.
> The problem is in _prepare_kernel_and_initrd function of DistroInstaller.py.
>
Thanks for the report. This is actually already fixed upstream though:
http://git.fedorahosted.org/git/?p=python-virtinst.git;a=commit;h=b7054426336929abb0ab0d822ad208a11d418904
Thanks,
Cole
> my command line is:
>
> virt-install -n testredhat2 -r 1024 --vcpus=1 --disk
> path=/var/lib/libvirt/images/testredhat2.img,size=8 -l /mnt/
> --initrd-inject=/home/gongys/redhat/ks.cfg --extra-args "ks=file:/ks.cfg"
> --connect=qemu:///system --vnc -v --network bridge=br0 --dry-run -d
>
> where my RHEL6.1-20110510.1-Server-x86_64-DVD1.iso is mounted at /mnt.
>
> To fix it, I think we should add back three-line codes to set
> _install_bootconfig before we inject the initram:
> def _prepare_kernel_and_initrd(self, guest, meter):
> disk = None
>
> # If installing off a local path, map it through to a virtual CD/disk
> if (self.location is not None and
> self._location_is_path and
> not os.path.isdir(self.location)):
>
> device = VirtualDisk.DEVICE_CDROM
> if (self.is_xenpv() and
> not guest._lookup_osdict_key('pv_cdrom_install')):
> device = VirtualDisk.DEVICE_DISK
>
> disk = VirtualDisk(conn=guest.conn,
> device=device,
> path=self.location,
> readOnly=True,
> transient=True)
>
> # Make sure we always fetch kernel here if required
> if self._install_bootconfig.kernel and not self.scratchdir_required():
> return disk
>
> # Need to fetch the kernel & initrd from a remote site, or
> # out of a loopback mounted disk image/device
> ignore, os_type, os_variant, media = OSDistro.acquireKernel(guest,
> self.location, meter,
> self.scratchdir,
> self.os_type)
> (kernelfn, initrdfn, args) = media
>
> if guest.get_os_autodetect():
> if os_type:
> logging.debug("Auto detected OS type as: %s" % os_type)
> guest.os_type = os_type
>
> if (os_variant and guest.os_type == os_type):
> logging.debug("Auto detected OS variant as: %s" % os_variant)
> guest.os_variant = os_variant
>
> self._install_bootconfig.kernel = kernelfn
> self._install_bootconfig.initrd = initrdfn
> self._install_bootconfig.kernel_args = args
>
> self._tmpfiles.append(kernelfn)
> if initrdfn:
> self._tmpfiles.append(initrdfn)
>
> if self._initrd_injections:
> self._perform_initrd_injections()
>
> # If required, upload media to an accessible guest location
> kernelfn, initrdfn = self._upload_media(guest, meter,
> kernelfn, initrdfn)
>
> self._install_bootconfig.kernel = kernelfn
> self._install_bootconfig.initrd = initrdfn
> self._install_bootconfig.kernel_args = args
>
> return disk
>
> Thanks
>
>
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
More information about the virt-tools-list
mailing list