Hello community, here is the log from the commit of package virt-v2v for openSUSE:Factory checked in at 2014-05-14 10:48:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/virt-v2v (Old) and /work/SRC/openSUSE:Factory/.virt-v2v.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "virt-v2v" Changes: -------- --- /work/SRC/openSUSE:Factory/virt-v2v/virt-v2v.changes 2014-04-03 17:20:36.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.virt-v2v.new/virt-v2v.changes 2014-05-14 10:48:36.000000000 +0200 @@ -1,0 +2,44 @@ +Mon May 5 16:54:05 UTC 2014 - [email protected] + +- Add missing dependencies (bnc#876317) +- Update OVA conversion code for improved support of OVF 2.0. + handle_ova_files.patch +- Update preallocation change to effect all target storage types + other than dir, fs and netfs. + preallocate-if-lvm.patch + +------------------------------------------------------------------- +Thu May 01 19:06:29 UTC 2014 - [email protected] + +- Ignore SLES12 specific error when a package is not found. + catch_sles12_pkg_not_found.patch +- Rename VirtualBox image names in examples to be more generic. + rename_vb_examples.patch +- As SLES12 does not provide a libvirt driver for VMware ESX, examples + and docs regarding this driver are no longer provided (bnc#875622) + remove_esx_examples.patch +- Check virtio capabilities of any kernel installed (after installing + virtio capabilities. + reset_virtio_after_config.patch +- Resolve 'Failed to open {path}' message with OVA files (bnc#875857) + handle_ova_files.patch + +------------------------------------------------------------------- +Thu Apr 28 22:48:04 UTC 2014 - [email protected] + +- Add guest conversion support for: + SUSE Linux Enterprise Server (SLES) 12 + Microsoft Windows 7 + Microsoft Windows 8/8.1 + Microsoft Windows 2012/2012r2 + add_sles12_win7-2012.patch +- Ensure initrd paths have a leading / and device.map is updated + in grub2 environments. + catch_invalid_initrd_path.patch +- If guest is using btrfs for root, remove duplicate entries to avoid + prompting the user. + remove-duplicate-btrfs-roots.patch +- Force preallocation if outputting to an LVM storage pool (bnc#874782). + preallocate-if-lvm.patch + +------------------------------------------------------------------- New: ---- add_sles12_win7-2012.patch catch_invalid_initrd_path.patch catch_sles12_pkg_not_found.patch handle_ova_files.patch preallocate-if-lvm.patch remove-duplicate-btrfs-roots.patch remove_esx_examples.patch rename_vb_examples.patch reset_virtio_after_config.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ virt-v2v.spec ++++++ --- /var/tmp/diff_new_pack.hybTRb/_old 2014-05-14 10:48:37.000000000 +0200 +++ /var/tmp/diff_new_pack.hybTRb/_new 2014-05-14 10:48:37.000000000 +0200 @@ -33,6 +33,15 @@ Patch4: fix_manifest.patch Patch5: remove_rhev_help.patch Patch6: suppress_warnings.patch +Patch7: add_sles12_win7-2012.patch +Patch8: catch_invalid_initrd_path.patch +Patch9: remove-duplicate-btrfs-roots.patch +Patch10: preallocate-if-lvm.patch +Patch11: catch_sles12_pkg_not_found.patch +Patch12: rename_vb_examples.patch +Patch13: reset_virtio_after_config.patch +Patch14: handle_ova_files.patch +Patch99: remove_esx_examples.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Backported upstream patches @@ -104,6 +113,16 @@ # For ssh transfers Requires: /usr/bin/ssh +# For libvirt and ESX connections and transfers +Requires: perl(URI) + +# For Windows conversions +Requires: perl(IO::String) + +# For OVA conversions +Requires: perl(Archive::Extract) +Requires: perl(Digest::SHA1) + #Additional requirements to run on openSUSE 12.3 Requires: guestfs-tools >= 1.22 Requires: perl-DateTime >= 0.72 @@ -135,6 +154,18 @@ %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +# Apply remove_esx_example.patch only under SLES12 +%if 0%{?suse_version} == 1315 +%patch99 -p1 +%endif %build %{__perl} Build.PL ++++++ add_sles12_win7-2012.patch ++++++ Add support for SLES12 and Windows 7 - 2012r2 to virt-v2v.db. Index: virt-v2v-0.9.1/v2v/virt-v2v.db =================================================================== --- virt-v2v-0.9.1.orig/v2v/virt-v2v.db +++ virt-v2v-0.9.1/v2v/virt-v2v.db @@ -49,7 +49,10 @@ the modifications or additions to /etc/v <dep name='xorg-x11-drv-qxl'/> </capability> - <!-- SLES 11 supports virtio in the default kernel--> + <!-- SLES 11+ supports virtio in the default kernel--> + <capability os='linux' distro='sles' major='12' name='virtio'> + <dep name='kernel'/> + </capability> <capability os='linux' distro='sles' major='11' name='virtio'> <dep name='kernel'/> </capability> @@ -221,6 +224,12 @@ the modifications or additions to /etc/v <path>rhel/4/kernel-largesmp-2.6.9-89.EL.x86_64.rpm</path> </app> + <!-- SLES 12 + This RPM is from SLES12 (x86_64 only). --> + <app os='linux' distro='sles' major='12' arch='x86_64' name='kernel-default'> + <path>sles/12/kernel-default-3.12.18-1.2.x86_64.rpm</path> + </app> + <!-- SLES 11 All of these RPMs are from SLES11 SP3. SLES 11 requires both a kernel-[flavor] and a kernel-[flavor]-base --> @@ -287,12 +296,30 @@ the modifications or additions to /etc/v <app os='windows' major='5' minor='2' arch='x86_64' name='virtio'> <path>/usr/share/virtio-win/drivers/amd64/Win2003</path> </app> - <app os='windows' major='6' arch='i386' name='virtio'> + <app os='windows' major='6' minor='0' arch='i386' name='virtio'> <path>/usr/share/virtio-win/drivers/i386/Win2008</path> </app> - <app os='windows' major='6' arch='x86_64' name='virtio'> + <app os='windows' major='6' minor='0' arch='x86_64' name='virtio'> <path>/usr/share/virtio-win/drivers/amd64/Win2008</path> </app> + <app os='windows' major='6' minor='1' arch='i386' name='virtio'> + <path>/usr/share/virtio-win/drivers/i386/Win7</path> + </app> + <app os='windows' major='6' minor='1' arch='x86_64' name='virtio'> + <path>/usr/share/virtio-win/drivers/amd64/Win7-r2</path> + </app> + <app os='windows' major='6' minor='2' arch='i386' name='virtio'> + <path>/usr/share/virtio-win/drivers/i386/Win8</path> + </app> + <app os='windows' major='6' minor='2' arch='x86_64' name='virtio'> + <path>/usr/share/virtio-win/drivers/amd64/Win8-2012</path> + </app> + <app os='windows' major='6' minor='3' arch='i386' name='virtio'> + <path>/usr/share/virtio-win/drivers/i386/Win8.1</path> + </app> + <app os='windows' major='6' minor='3' arch='x86_64' name='virtio'> + <path>/usr/share/virtio-win/drivers/amd64/Win8.1-2012r2</path> + </app> <!-- pvvxsvc is a 32 bit app even on 64 bit Windows --> <app os='windows' name='pvvxsvc'> ++++++ catch_invalid_initrd_path.patch ++++++ In some cases (specifically, SUSE grub2 environments) it is possible to fail to update the block entries in device.map. In turn, this causes an invalid path to be returned in perl-Bootloader code, which causes the conversion to fail with the following message: is_file_opts: is_file: is_file_stub: path must start with a / character This patch prevents the problem by adding device.map (for /boot/grub and /boot/grub2) to the list of configurations to remap, then adds a check to ensure invalid paths are not passed to is_file_opts. Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Converter/Linux.pm =================================================================== --- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Converter/Linux.pm +++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Converter/Linux.pm @@ -56,7 +56,10 @@ sub get_initrd if (defined($initrd)) { # If the initrd starts with (hdX,X), remove it. $initrd =~ s/^\(hd.*\)//; - return $initrd if ($g->is_file_opts($initrd, followsymlinks=>1)); + # Catch invalid paths by ensuring first character is '/' + if ($initrd =~ /^\//) { + return $initrd if $g->is_file_opts($initrd, followsymlinks=>1); + } } } @@ -2672,13 +2675,13 @@ sub _remap_block_devices # Add standard configuration files to the checklist push (@checklist, '/files/etc/fstab/*/spec'); + push (@checklist, '/files/boot/*/device.map/*'. + '[label() != "#comment"]'); # Add grub or grub2 files to the checklist if (defined($grub->{grub_conf})) { push (@checklist, "/files$grub->{grub_conf}/*/kernel/root"); push (@checklist, "/files$grub->{grub_conf}/*/kernel/resume"); - push (@checklist, '/files/boot/grub/device.map/*'. - '[label() != "#comment"]'); } elsif (defined($grub->{cfg})) { push (@checklist, '/files/etc/sysconfig/grub/GRUB_CMDLINE_LINUX'); ++++++ catch_sles12_pkg_not_found.patch ++++++ The zypper version included with SLES12 reports an error if a specified package is not found. This is different than SLES11, where a message was simply reported. Catch the error with this patch, and ignore it as further attempts will be made to install the package. Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Converter/Linux.pm =================================================================== --- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Converter/Linux.pm +++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Converter/Linux.pm @@ -1837,9 +1837,12 @@ sub _install_any } # Fall back to local config if the above didn't work - $success = _install_config($kernel, $install, $upgrade, - $g, $root, $config) - unless ($success); + if (!$success) { + logmsg WARN, __x('Online install failed, trying local '. + 'virt-v2v repository.'); + $success = _install_config($kernel, $install, $upgrade, + $g, $root, $config); + } }; warn($@) if $@; }); @@ -2011,6 +2014,7 @@ sub _install_zypper my $success = 1; # Error when installing: "No provider of 'pkg' found." + # Error (new in SLES12) when installing: "Package 'pkg' not found." # (Not an) Error when updating: "Package 'pkg' is not available in your # repositories. Cannot reinstall, upgrade, or downgrade." ZYPPER: foreach my $task ( @@ -2043,7 +2047,7 @@ sub _install_zypper if ($@) { # Ignore 'No provider' errors as an install from the virt-v2v # repo will be attempted next. - if ($@ !~ /No provider/) { + if (($@ !~ /No provider/) && ($@ !~ /not found/)) { logmsg WARN, __x('Failed to install packages. '. 'Error was: {error}', error => $@); } @@ -2096,7 +2100,7 @@ sub _install_config \@missing, $g->inspect_get_arch($root), @$user); # We can't proceed if there are any files missing - v2vdie __x('Installation failed because the following '. + v2vdie __x('Local package installation failed because the following '. 'files referenced in the configuration file are '. 'required, but missing: {list}', list => join(' ', @missing)) if scalar(@missing) > 0; ++++++ handle_ova_files.patch ++++++ In order to support current OVF and VMDK standards, the following changes were required: - Support subdirectories in ova archives (OVF v2.0 standard) - Open VMDK files in read-only mode (required for version 3) - Repace rasd:ResourceSubType with rasd:ResourceType, and map types 10/11 to 'network', and types 30/33 to 'bridge' networks - Improve 'No mappings found' messages when network translation fails Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Connection/VMwareOVASource.pm =================================================================== --- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Connection/VMwareOVASource.pm +++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Connection/VMwareOVASource.pm @@ -116,13 +116,16 @@ sub _uncompress_archive my $ae = Archive::Extract->new(archive => $ova, type => 'tar'); $ae->extract(to => $self->{extractdir}); + # If the first extracted file ends in /, it's a subdirectory (which is + # valid in OVF 2.0). Set 'subdir' to this directory, or ''. + $self->{subdir} = ($ae->files->[0] =~/\/$/) ? $ae->files->[0] : ''; } sub _get_meta { my $self = shift; - my ($ovf) = glob($self->{extractdir}.'/*.ovf'); + my ($ovf) = glob($self->{extractdir}.'/'.$self->{subdir}.'*.ovf'); my $dom = new XML::DOM::Parser->parsefile($ovf) or v2vdie __x('Failed to open {ovf} for reading', ovf => $ovf); my $root = $dom->getDocumentElement(); @@ -202,7 +205,28 @@ sub _get_meta $info{mac} = undef; # it's assigned automatically by the hypervisor $info{vnet} = _node_val($nic, 'rasd:Connection/text()'); # not clear how to get it from the ovf - $info{vnet_type} = _node_val($nic, 'rasd:ResourceSubType/text()'); + # According to Resource Allocation Profile docs (www.dmtf.org) + # and cim-schema (CIM_ResourceAllocationSettingData.mof): + # + # rasd:ResourceType: uint16 referencing a specific type of resource + # 10 = Ethernet Adapter + # 11 = Other Network Adapter + # 30 = Ethernet Switch Port + # 33 = Ethernet Connection + # rasd:ResourceSubType: string describing a sub-type or model of resource + # + # However, it is unclear at this stage if the ResourceType value should + # be assigned a network or a bridge. For now, set 10/11 to 'network', + # and 30/33 to 'bridge'. If unexpected values are encounted, use the + # the nic model (and a mapping error is likely). + $info{vnet_type} = _node_val($nic, 'rasd:ResourceType/text()'); + if ($info{vnet_type} =~ /^(10|11)$/) { + $info{vnet_type} = 'network'; + } elsif ($info{vnet_type} =~ /^(30|33)$/) { + $info{vnet_type} = 'bridge'; + } else { + $info{vnet_type} = _node_val($nic, 'rasd:ResourceSubType/text()'); + } push(@{$meta{nics}}, \%info); } } @@ -254,7 +278,7 @@ sub _verify_manifest { my $self = shift; - my ($mf_path) = glob($self->{extractdir}.'/*.mf'); + my ($mf_path) = glob($self->{extractdir}.'/'.$self->{subdir}.'*.mf'); open(my $manifest, '<', $mf_path) or v2vdie __x('Failed to open {path}: {error}', path => $mf_path, error => $!); @@ -267,7 +291,7 @@ sub _verify_manifest close($manifest); while (my ($file, $sha1_mf) = each(%files)) { - open(my $fh, $self->{extractdir}.'/'.$file) + open(my $fh, $self->{extractdir}.'/'.$self->{subdir}.$file) or v2vdie __x('Manifest references non-existant file {name}', name => $file); @@ -302,7 +326,7 @@ sub _get_volume my $name = _node_val($file, '@ovf:href'); die "No href for file $fileRef" unless defined($name); - my $path = $self->{extractdir}."/$name"; + my $path = $self->{extractdir}.'/'.$self->{subdir}."$name"; die __x("Guest disk image {path} is not readable.\n", path => $path) unless (-r $path); Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/GuestfsHandle.pm =================================================================== --- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/GuestfsHandle.pm +++ virt-v2v-0.9.1/lib/Sys/VirtConvert/GuestfsHandle.pm @@ -77,9 +77,13 @@ sub new foreach my $disk (@{$disks}) { my ($name, $path, $format) = @$disk; + # VMDK version 3 disks must be read only + my $readonly = ($format eq 'vmdk') ? 1 : 0; + $g->add_drive_opts($path, format => $format, - name => $name); + name => $name, + readonly => $readonly); } # Add the transfer iso if there is one Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Config.pm =================================================================== --- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Config.pm +++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Config.pm @@ -497,10 +497,10 @@ sub map_network return @{$self->{default_net_mapping}} if (defined($self->{default_net_mapping})); - logmsg WARN, __x('No mapping found for {type} interface '. - '{name} in config file. The converted guest may '. - 'not start until its network interface is updated.', - type => $oldtype, name => $oldname); + logmsg WARN, __x('No mapping found for "network type=\'{type}\' '. + 'name=\'{name}\'" in config file. The converted '. + 'guest may not start until its network interface '. + 'is updated.', type => $oldtype, name => $oldname); return; } ++++++ preallocate-if-lvm.patch ++++++ If destination storage target is an LVM pool, the root partition will not be found if using the default (sparse) allocation scheme. Buffer I/O errors can also be seen in dmesg. This problem is due to the spare allocation scheme not being supported for LVM storage pools. The only pool types which support sparse files are dir, fs and netfs. This patch forces the preallocated scheme when other storage pool targets are specified. Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Connection/LibVirtTarget.pm =================================================================== --- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Connection/LibVirtTarget.pm +++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Connection/LibVirtTarget.pm @@ -178,6 +178,13 @@ sub create_volume if ($Sys::VirtConvert::Connection::LibVirt::format_pools{$pooltype}) { $vol_xml = $vol_xml_format; } else { + # Sparse allocations are not supported on raw-only pool types + if ($sparse eq '1') { + logmsg WARN, __x('Target pool type {pooltype} doesn\'t '. + 'support sparse allocations', + pooltype => $pooltype); + $vol_xml_noformat =~ s/tion>0<\/alloca/tion>$size<\/alloca/; + } $vol_xml = $vol_xml_noformat; # If the target format type isn't raw, warn the user that they're ++++++ remove-duplicate-btrfs-roots.patch ++++++ When the guest is using btrfs on the root filesystem, duplicate root devices will be detected. If this happens, strip out the 'btrfsvol' version, and use the standard partition entry. Index: virt-v2v-0.9.1/v2v/virt-v2v.pl =================================================================== --- virt-v2v-0.9.1.orig/v2v/virt-v2v.pl +++ virt-v2v-0.9.1/v2v/virt-v2v.pl @@ -693,6 +693,14 @@ sub inspect_guest @roots = sort @roots; + # If using btrfs, it is possible to have the same partition listed using + # two different names (e.g. '/dev/sda2' and 'btrfsvol:/dev/sda2/@'). + # In this case, filter out the duplicate 'btrfsvol' entry. + if ((@roots == 2) && ("btrfsvol:$roots[0]/@" eq "$roots[1]")) { + @roots = grep(/^btrfsvol/, @roots); + } + + my $root_dev; if(@roots == 0) { ++++++ remove_esx_examples.patch ++++++ SLES12 does not ship an ESX libvirt driver. This patch removes samples and documentation for this type of connection from the virt-v2v help screen and man page. It also removes documentation regarding exporting a guest to RHEV. Index: virt-v2v-0.9.1/v2v/virt-v2v.pl =================================================================== --- virt-v2v-0.9.1.orig/v2v/virt-v2v.pl +++ virt-v2v-0.9.1/v2v/virt-v2v.pl @@ -50,8 +50,6 @@ virt-v2v - Convert a guest to use KVM virt-v2v -ic xen+ssh://xen.server/ -os imported --network default xen_guest - virt-v2v -ic esx://esx.server/ -os imported --network default esx_guest - =head1 DESCRIPTION virt-v2v converts guests from a foreign hypervisor to run on KVM,managed by @@ -99,8 +97,8 @@ this defaults to qemu:///system when vir when virt-v2v runs as a regular user. B<N.B.> virt-v2v can currently automatically obtain guest storage from local -libvirt connections, ESX connections, and connections over SSH. Other types of -connection are not supported. +libvirt connections, and connections over SSH. Other types of connection are +not supported. =cut @@ -899,112 +897,6 @@ which won't reference a hypervisor in it make this newly installed kernel your default kernel because Xen may not boot it. virt-v2v will make it the default during conversion. -=head1 CONVERTING A GUEST FROM VMWARE ESX - -B<N.B.> libvirt version 0.7.0 or greater is required to connect to ESX. - -virt-v2v can convert a guest from VMware ESX, including transferring its -storage. - -B<N.B.> virt-v2v does not transfer snapshots from ESX. Only the latest flat -storage is transferred. - -The guest MUST be shut down in ESX before conversion starts. virt-v2v will not -proceed if the guest is still running. To convert the guest, run: - - virt-v2v -ic esx://<esx.server>/ -os <pool> [--network <network name>] \ - <domain> - -where: - -=over - -=item * - -E<lt>esx.serverE<gt> is the hostname of the ESX server hosting the guest to be -converted. - -B<N.B.> This hostname must match the hostname reported in the ESX server's SSL -certificate, or verification will fail. - -=item * - -E<lt>poolE<gt> is the name of the local storage pool where copies of the guest's -storage will be created. - -=item * - -E<lt>domainE<gt> is the name of the guest on the ESX server which is to be -converted. - -=back - -The I<--network> option may be provided for simple network mappings. For more -complex mappings, see L<virt-v2v.conf(5)>. - -=head2 Authenticating to the ESX server - -Connecting to the ESX server will require authentication. virt-v2v supports -password authentication when connecting to ESX. It reads passwords from -$HOME/.netrc. The format of this file is described in L<netrc(5)>. An example -entry is: - - machine esx01.example.com login root password s3cr3t - -B<N.B.> The permissions of .netrc MUST be set to 0600, or it will be ignored. - -=head2 Connecting to an ESX server with an invalid certificate - -In non-production environments, the ESX server may have an invalid certificate, -for example a self-signed certificate. In this case, certificate checking can be -explicitly disabled by adding '?no_verify=1' to the connection URI as shown -below: - - ... -ic esx://<esx.server>/?no_verify=1 ... - -=head1 EXPORTING A GUEST TO RHEV - -virt-v2v can export to RHEV any guest that it can convert. This includes: - -=over - -=item * - -Local Xen guests - -=item * - -ESX guests - -=item * - -Local libvirt/KVM guests - -=back - -To export to RHEV, specify I<-o rhev> on the command line, and ensure I<-os> -specifies the location of a RHEV export storage domain as in the following -examples: - -=over - -=item Exporting a local Xen guest to RHEV - - virt-v2v -i libvirtxml -o rhev -os <export_sd> \ - [--network <network name>] <domain>.xml - -=item Export a VMware ESX guest to RHEV - - virt-v2v -ic esx://<esx.server>/ -o rhev -os <export_sd> \ - [--network <network name>] <domain> - -=item Export a local libvirt/KVM guest to RHEV - - virt-v2v -o rhev -os <export_sd> [--network <network name>] \ - <domain> - -=back - =head1 RUNNING THE CONVERTED GUEST =head2 Libvirt output method ++++++ rename_vb_examples.patch ++++++ Replace 'rhel' with 'box' in the name of the VirtualBox images. Index: virt-v2v-0.9.1/v2v/virt-v2v.pl =================================================================== --- virt-v2v-0.9.1.orig/v2v/virt-v2v.pl +++ virt-v2v-0.9.1/v2v/virt-v2v.pl @@ -815,14 +815,14 @@ and are being converted to KVM. The conv file which needs to be adjusted for the guest to be converted (at least name, uuid, image path, image type, and MAC address): - qemu-img convert -O qcow2 /tmp/v-rhel.vdi /var/lib/libvirt/images/v-rhel.img + qemu-img convert -O qcow2 /tmp/v-box.vdi /var/lib/libvirt/images/v-box.img virsh --connect qemu:///system pool-refresh default - virt-cat /var/lib/libvirt/images/v-rhel.img \ + virt-cat /var/lib/libvirt/images/v-box.img \ /etc/sysconfig/network-scripts/ifcfg-eth0 | grep ^HWADDR # Replace the MAC address in the guest XML definition file or adjust # ifcfg-eth0 after booting up the guest to match the MAC address defined in # XML file - virt-v2v -i libvirtxml -os default /tmp/v-rhel.xml + virt-v2v -i libvirtxml -os default /tmp/v-box.xml B<N.B.> For the time being when converting VirtualBox Windows guests the VirtualBox Guest Additions need to be manually uninstalled on the guest ++++++ reset_virtio_after_config.patch ++++++ If an online update of a specific kernel version fails (due to it not existing in the repo, or some other error), an update from the local virt-v2v repo is attempted. If that fails, virtio is disabled, and any available kernel is installed. During this process, it is possible to install a virtio capable kernel. This patch catches that condition, and resets $virtio to a value which matches the installed kernel. This patch also fixes the following two issues: - Only list valid kernels under grub2 (no symlinks) - Ensure $version is populated before checking for /lib/modules/$version Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Converter/Linux.pm =================================================================== --- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Converter/Linux.pm +++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Converter/Linux.pm @@ -509,8 +509,11 @@ sub list_kernels $g->glob_expand('/boot/vmlinuz-*'), $g->glob_expand('/vmlinuz-*')) { - push(@kernels, $kernel) - unless $kernel =~ /\.(?:dpkg-.*|rpmsave|rpmnew)$/; + # Only add normal files (no symbolic links) + if ($g->is_file_opts($kernel, followsymlinks=>0)) { + push(@kernels, $kernel) + unless $kernel =~ /\.(?:dpkg-.*|rpmsave|rpmnew)$/; + } } return @kernels; @@ -732,6 +735,12 @@ sub convert # Get an appropriate kernel, or install one if none is available my $kernel = _configure_kernel($virtio, $g, $root, $config, $meta, $grub); + # If _install_capability failed to install a specific version of kernel, + #_configure_kernel can install a virtio kernel. If it does, reset virtio + if (!$virtio) { + $virtio = _supports_virtio($kernel, $g); + } + # Install user custom packages if (! _install_capability('user-custom', $g, $root, $config, $meta, $grub)) { logmsg WARN, __('Failed to install user-custom packages'); @@ -1298,10 +1307,13 @@ sub _is_hv_kernel { my ($g, $version) = @_; - # Xen PV kernels can be distinguished from other kernels by their inclusion - # of the xennet driver - foreach my $entry ($g->find("/lib/modules/$version/")) { - return 1 if $entry =~ /(^|\/)xennet\.k?o$/; + # If modules directory was not found earlier, $version can be undefined + if (defined($version)) { + # Xen PV kernels can be distinguished from other kernels by their + # inclusion of the xennet driver + foreach my $entry ($g->find("/lib/modules/$version/")) { + return 1 if $entry =~ /(^|\/)xennet\.k?o$/; + } } return 0; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
