OSInside / kiwi

KIWI - Appliance Builder Next Generation
https://osinside.github.io/kiwi
GNU General Public License v3.0
304 stars 152 forks source link

multiple `vmdisk` elements are not supported #1337

Closed joshuakwan closed 4 years ago

joshuakwan commented 4 years ago

Problem description

On the official wiki, it is said that multiple vmdisk elements are supported:

The vmdisk element can be used to customize the disks and disk controllers for the virtual machine. This element can be specified multiple times, each time for each disk or disk controller present. 

which turned out not to be the case. 2 vmdisk are defined in our config xml:

            <machine ncpus="2" memory="8192" guestOS="sles15-64" ovftype="vmware" HWversion="14">
                <vmdisk id="0" controller="lsilogic"/>
                <vmdisk id="1" controller="lsilogic"/>
                <vmnic driver="vmxnet3" interface="0" mode="Network 1"/>
                <vmnic driver="vmxnet3" interface="1" mode="Network 2"/>
            </machine>

Got this:

kiwi-ng --debug --profile SLES --type vmx system build --description /vxrail-ova-configuration/configuration --target-dir /images  
[ INFO    ]: 06:24:25 | Reading runtime config file: /etc/kiwi.yml
[ INFO    ]: 06:24:25 | Reading runtime config file: /etc/kiwi.yml
[ DEBUG   ]: 06:24:25 | EXEC: [mkdir -p /images/build]
[ INFO    ]: 06:24:25 | Loading XML description
[ DEBUG   ]: 06:24:25 | EXEC: [jing /usr/lib/python3.6/site-packages/kiwi/schema/kiwi.rng /tmp/tmpwpviola1]
[ INFO    ]: 06:24:26 | RelaxNG validation failed. See jing report:
[ INFO    ]: 06:24:26 | --> /tmp/tmpwpviola1:50:55: error: element "vmdisk" not allowed here; expected the element end-tag or element "vmconfig-entry", "vmdvd" or "vmnic"

[ ERROR   ]: 06:24:26 | KiwiDescriptionInvalid: Schema validation for /vxrail-ova-configuration/configuration/config.xml failed

Expected behaviour

Multiple vmdisk should be supported according to the document.

Steps to reproduce the behaviour

Already covered in the description section

OS and Software information

davidcassany commented 4 years ago

Need to double check, but at a glance I'd say that the implementation is correct and the documentation might be wrong.

Kiwi does not build VMs with multiple drives, thus I don't see how it could be useful to define a <machine> section with multiple drives, but probably I am missing some use case. Will have a look.

Thanks for the report, there is clearly some inconsistency here.

joshuakwan commented 4 years ago

Need to double check, but at a glance I'd say that the implementation is correct and the documentation might be wrong.

Kiwi does not build VMs with multiple drives, thus I don't see how it could be useful to define a <machine> section with multiple drives, but probably I am missing some use case. Will have a look.

Thanks for the report, there is clearly some inconsistency here.

Thank you sir, I can talk a little bit more about our use case. We have been using VMware studio (which is not public applicable any more) to build the OVA image for our product, which has 2 hard drives configured. Recently we switched to kiwi to do the same thing, while it turns out that multiple vmdisk is not supported.

schaefi commented 4 years ago

We only support a very limited set of the features that the VMware guest configuration offers. For handling additional entries there is an extra vmconfig-entry section available in kiwi which just places the contents into the guest setup without further verification if they are correct. It looks like this:

<machine>
    <vmconfig-entry>text</vmconfig-entry>
</machine>

This allows you to put anything you are still missing in the guest setup. If the result is still a valid guest configuration needs to be checked by VMware's tooling.

If you need multiple lines to be added to your guest setup you can add as many vmconfig-entry sections as you need. It might look a bit strange in the end but we can't support a full featured guest setup within kiwi, so our scope is only on the image required settings.

Hope this makes sense to you and helps to solve your issue. If not feel free to open a followup issue. Thanks