Bug 1308535 - RFE: v2v: Copy bios.hddOrder to target
RFE: v2v: Copy bios.hddOrder to target
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs (Show other bugs)
7.3
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
V2V
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-15 08:16 EST by Richard W.M. Jones
Modified: 2018-02-01 21:14 EST (History)
16 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1297202
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2016-02-15 08:16:26 EST
+++ This bug was initially created as a clone of Bug #1297202 +++

Description of problem:
- When importing VM with many disks, the target VM may not run properly because bootable disk is not set on the correct disk or any other disks.
- When importing VM with 1 disk, the target VM is running properly although bootable disk does not set by import process.

Version-Release number of selected component (if applicable):
rhevm-3.6.2-0.1.el6
libvirt-client-1.2.17-13.el7_2.2.x86_64
qemu-kvm-rhev-2.3.0-31.el7_2.4.x86_64
vdsm-4.17.15-0.el7ev
sanlock-3.2.4-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Using import dialog, start import of VM with many disks (in my case, rhel7_21_disks).
2. Wait till import progress is completed.
3. Run VM.

Actual results:
VM is running but "no bootable device" message displayed when opening console.
Observing webadmin shows that none of the disks set as "bootable" disk.
Observing vdsm.log shows that bootorder definition is missing for the target disk.

Expected results:
Bootable disk should be defined by import process.
Comment 7 Richard W.M. Jones 2016-02-15 10:24:37 EST
Reading some public documentation about this, there are two ways
to change the boot order of VMware guests.

(1) In the VMware BIOS.  Hit [F2] on the console during the guest
boot, and you can select the boot order in there:

https://pubs.vmware.com/vsphere-4-esx-vcenter/index.jsp?topic=/com.vmware.vsphere.config_iscsi.doc_41/esx_san_config/booting/t_change_boot_sequence_bios.html

(2) However the modern way to do this is to add some entries
to the .vmx file.  Settings include bios.bootOrder and bios.hddOrder.
Neither is available through the API, you have to edit the .vmx
file directly.  See:

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2011654

The current libvirt driver does not expose the bios.bootOrder nor
bios.hddOrder settings.

If it did expose these, then it might be possible for virt-v2v to
translate these into the correct OVF, assuming we knew what the
correct OVF was meant to be.

-----

Here are some other things virt-v2v could do:

(a) Not put the ovf:boot option in the OVF at all.  This punts the
issue entirely over to oVirt to sort out.

(b) Do some kind of guest inspection to try to determine the boot
device.  (This sounds like it's going to be difficult to do).

-----

To take this further I'm going to need:

(i) *.vmx file from the source guest which failed to boot.

(ii) Some guidance about what you'd like to happen.

(iii) Exact description of how to control the boot order through OVF.
Comment 10 Richard W.M. Jones 2016-02-17 09:30:40 EST
Updating Summary etc to make it clearer this is now a wishlist
item for virt-v2v.
Comment 11 Shmuel Melamud 2016-02-17 09:46:46 EST
In any case, virt-v2v must set correct BootOrder in the OVF it generates (just ovf:boot is not enough, it just marks a disk as bootable, but doesn't set the boot order). Currently, this was fixed by patching on oVirt level (https://gerrit.ovirt.org/#/c/53037/), but this is not a correct solution.
Comment 12 Richard W.M. Jones 2016-02-17 09:51:54 EST
(In reply to Shmuel Melamud from comment #11)
> In any case, virt-v2v must set correct BootOrder in the OVF it generates
> (just ovf:boot is not enough, it just marks a disk as bootable, but doesn't
> set the boot order). Currently, this was fixed by patching on oVirt level
> (https://gerrit.ovirt.org/#/c/53037/), but this is not a correct solution.

This is news to me.  What should the <BootOrder> element look like?
Comment 13 Shmuel Melamud 2016-02-17 09:59:37 EST
Here's an example:

<Item>
            <rasd:Caption>VM100_Disk1</rasd:Caption>
            <rasd:InstanceId>cb39ad76-c80f-4b59-a2b9-ff2da59e9b73</rasd:InstanceId>
            <rasd:ResourceType>17</rasd:ResourceType>
            <rasd:HostResource>2c5fc317-5dd1-46ac-89cc-0208bb354196/cb39ad76-c80f-4b59-a2b9-ff2da59e9b73</rasd:HostResource>
            <rasd:Parent>00000000-0000-0000-0000-000000000000</rasd:Parent>
            <rasd:Template>00000000-0000-0000-0000-000000000000</rasd:Template>
            <rasd:ApplicationList />
            <rasd:StorageId>7990f391-063a-4258-8117-231e2ec821c2</rasd:StorageId>
            <rasd:StoragePoolId>e5838493-2ce1-44f0-8c02-77726cf2d96c</rasd:StoragePoolId>
            <rasd:CreationDate>2016/02/01 14:06:05</rasd:CreationDate>
            <rasd:LastModified>1970/01/01 00:00:00</rasd:LastModified>
            <rasd:last_modified_date>2016/02/01 14:06:36</rasd:last_modified_date>
            <Type>disk</Type>
            <Device>disk</Device>
            <rasd:Address />
            <BootOrder>1</BootOrder>
            <IsPlugged>true</IsPlugged>
            <IsReadOnly>false</IsReadOnly>
            <Alias />
         </Item>
Comment 14 Richard W.M. Jones 2016-06-22 10:47:42 EDT
The following commit sets the <BootOrder> element to 1 for the
first disk, 2 for the second disk and so on:

https://github.com/libguestfs/libguestfs/commit/94e1504146bfb2d0dd9661865d0a423b6be07eb7

This doesn't solve the problem of how to copy the correct boot
order from the source hypervisor, which isn't generally solvable
without changes to libvirt (see comment 7).
Comment 15 Richard W.M. Jones 2017-02-16 09:23:41 EST
Still a wishlist item, and still requires changes to the libvirt
ESX driver to expose the bios.bootOrder and bios.hddOrder entries
from the source .vmx file

Note You need to log in before you can comment on or make changes to this bug.