OSInside / kiwi

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

howto build VMDK with SCSI disk? #2144

Open black13ua opened 2 years ago

black13ua commented 2 years ago

Problem description

Cant build VMDK with SCSI disk (always IDE) My config:

    <preferences profiles="Virtual_LVM">
        <type image="oem" filesystem="ext4" firmware="uefi" format="vmdk" kernelcmdline="crashkernel=auto net.ifnames=0 rhgb quiet">
            <bootloader name="grub2" console="serial" timeout="3"/>
            <systemdisk name="ol">
                <volume name="@root=root" size="3G"/>
                <volume name="home" size="1G"/>
                <volume name="tmp" size="512M"/>
                <volume name="var" size="3G"/>
                <volume name="var_log" size="3G" mountpoint="/var/log"/>
                <volume name="var_tmp" size="512M" mountpoint="/var/tmp"/>
            </systemdisk>
            <oemconfig>
                <oem-resize>false</oem-resize>
            </oemconfig>
            <machine memory="1024" guestOS="oraclelinux8-64" HWversion="14">
              <vmdisk id="0" controller="pvscsi"/>
            </machine>
            <size unit="G">30</size>
        </type>
    </preferences>

Expected behaviour

expect VMDK disk ready for using in VMWare ESX

Steps to reproduce the behaviour

OS and Software information

black13ua commented 2 years ago

inside VMDK this settings:

version=1
CID=a3b9129d
parentCID=ffffffff
createType="monolithicSparse"

# Extent description
RW 62914560 SPARSE "kiwi-image-v8.x86_64-1.3.0.vmdk"

# The Disk Data Base
#DDB

ddb.virtualHWVersion = "4"
ddb.geometry.cylinders = "3916"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "lsilogic"
schaefi commented 2 years ago

Oh well this topic... It would be really good if we can finally solve this. Let me summarize the issue:

Now some time in the past a VMware engineer came across our way and said this patching back to pvscsi should not be done because lsilogic is "scsi" too and the mapping in the guest can transparently done by the guest configuration file. The .vmx file created in a rough form by kiwi and which most users adapt through their VMware software until its final state

For the fill story see the change regarding this here:

commit 687a2decf934d12c07e8c40dc9691eb4a6b45a62 (origin/delete_obsolete_ddb_adapter_hack, delete_obsolete_ddb_adapter_hack)
Author: Marcus Schäfer <marcus.schaefer@gmail.com>
Date:   Mon Jan 11 15:02:52 2021 +0100

    Delete obsolete ddb.adapterType patching

    When building a vmdk image with pvscsi as adapter type, kiwi
    implicitly changed the adapter_type from pvscsi to lsilogic
    because qemu only knows lsilogic. At the end kiwi patched
    the adapter type in the descriptor of the vmdk header back
    to pvscsi. That patching seems to be wrong according to
    information from users and VMware support. This commit
    deletes the descriptor patching and only leaves the pvscsi
    setting in the guest configuration(vmx).
    This Fixes bsc#1180539 and Fixes #1847

Also see the referenced conversation from #1847

To be really honest I'm tired about this back and forth and it just needs somebody who is really committed to test in ESX and report feedback how it works and should be done in VMware. I do not have any access to the proprietary VMware product portfolio and the conversations with people in this area were unfortunately not very open. I felt more or less ignored.

So forgive me when I'm not too enthusiastic to work towards VMware support. I'm very open to adapt, change fix but only if there is a working feedback loop.

Thus please check on the information I have provided and maybe that helps to already fix your issue. If not I need a suggestion for a way how we can provide patches that actually gets tested and not ignored within the proprietary ESX environment. I have no access to it at all.

Thanks much

black13ua commented 2 years ago

@schaefi Thanks for info! I reread docs and rebuild images with various options 100500 times and dont get what i miss ))

I'm not ESX expert, just use vmware esx 6.7u3. If its help i can create VM by vsphere and provide VMX file + VMDK headers Maybe you have some kiwi commits/patches for test - i can test it

schaefi commented 2 years ago

@schaefi Thanks for info! I reread docs and rebuild images with various options 100500 times and dont get what i miss ))

LOL :)

I'm not ESX expert, just use vmware esx 6.7u3. If its help i can create VM by vsphere and provide VMX file + VMDK headers Maybe you have some kiwi commits/patches for test - i can test it

yeah that would be awesome. So I can have a look at some good result and we can check it

black13ua commented 2 years ago

By vSphere Client version 6.7.0.50000 i created 3 VMs 1cpu, 1gb ram, 16mb disk (ESX 6.7u3):

  1. vm_hw13 (hardware version 13)
~$ cat vm_hw13.vmdk 
# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=fffffffe
parentCID=ffffffff
createType="vmfs"

# Extent description
RW 32768 VMFS "vm_hw13-flat.vmdk"

# The Disk Data Base 
#DDB

ddb.adapterType = "lsilogic"
ddb.geometry.cylinders = "16"
ddb.geometry.heads = "64"
ddb.geometry.sectors = "32"
ddb.longContentID = "02a0dae9496cf05f4688336ffffffffe"
ddb.uuid = "60 00 C2 9b b1 b7 12 59-95 97 c1 b9 35 b8 a5 d2"
ddb.virtualHWVersion = "14"
~$
~$ cat vm_hw13.vmx
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "13"
nvram = "vm_hw13.nvram"
pciBridge0.present = "TRUE"
svga.present = "TRUE"
pciBridge4.present = "TRUE"
pciBridge4.virtualDev = "pcieRootPort"
pciBridge4.functions = "8"
pciBridge5.present = "TRUE"
pciBridge5.virtualDev = "pcieRootPort"
pciBridge5.functions = "8"
pciBridge6.present = "TRUE"
pciBridge6.virtualDev = "pcieRootPort"
pciBridge6.functions = "8"
pciBridge7.present = "TRUE"
pciBridge7.virtualDev = "pcieRootPort"
pciBridge7.functions = "8"
vmci0.present = "TRUE"
hpet0.present = "TRUE"
floppy0.present = "FALSE"
svga.vramSize = "8388608"
memSize = "1024"
powerType.powerOff = "default"
powerType.suspend = "default"
powerType.reset = "default"
tools.upgrade.policy = "manual"
sched.cpu.units = "mhz"
sched.cpu.affinity = "all"
sched.cpu.latencySensitivity = "normal"
vm.createDate = "1653290894522784"
scsi0.virtualDev = "pvscsi"
scsi0.present = "TRUE"
sata0.present = "TRUE"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.fileName = "vm_hw13.vmdk"
sched.scsi0:0.shares = "normal"
sched.scsi0:0.throughputCap = "off"
scsi0:0.present = "TRUE"
ethernet0.virtualDev = "vmxnet3"
ethernet0.networkName = "VM Network"
ethernet0.addressType = "vpx"
ethernet0.generatedAddress = "00:50:56:82:5c:9d"
ethernet0.uptCompatibility = "TRUE"
ethernet0.present = "TRUE"
sata0:0.startConnected = "FALSE"
sata0:0.deviceType = "cdrom-raw"
sata0:0.clientDevice = "TRUE"
sata0:0.fileName = "emptyBackingString"
sata0:0.present = "TRUE"
displayName = "vm_hw13"
guestOS = "centos7-64"
toolScripts.afterPowerOn = "TRUE"
toolScripts.afterResume = "TRUE"
toolScripts.beforeSuspend = "TRUE"
toolScripts.beforePowerOff = "TRUE"
uuid.bios = "42 02 13 68 1b 52 b9 40-1c 66 22 72 55 5d d8 77"
vc.uuid = "50 02 23 e7 0f 59 10 a3-5b 67 71 24 fa 3d 21 e6"
migrate.hostLog = "vm_hw13-1eceb530.hlog"
sched.cpu.min = "0"
sched.cpu.shares = "normal"
sched.mem.min = "0"
sched.mem.minSize = "0"
sched.mem.shares = "normal"
migrate.encryptionMode = "opportunistic"
~$
  1. vm_hw14 (hardware version 14)
    
    # Disk DescriptorFile
    version=1
    encoding="UTF-8"
    CID=fffffffe
    parentCID=ffffffff
    createType="vmfs"

Extent description

RW 32768 VMFS "vm_hw14-flat.vmdk"

The Disk Data Base

DDB

ddb.adapterType = "lsilogic" ddb.geometry.cylinders = "16" ddb.geometry.heads = "64" ddb.geometry.sectors = "32" ddb.longContentID = "de9f5bf7cf4defa12a450da7fffffffe" ddb.uuid = "60 00 C2 90 b5 79 06 f4-78 40 c5 f5 8d c2 06 06" ddb.virtualHWVersion = "14" ~$

```~$ cat vm_hw14.vmx
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "14"
nvram = "vm_hw14.nvram"
pciBridge0.present = "TRUE"
svga.present = "TRUE"
pciBridge4.present = "TRUE"
pciBridge4.virtualDev = "pcieRootPort"
pciBridge4.functions = "8"
pciBridge5.present = "TRUE"
pciBridge5.virtualDev = "pcieRootPort"
pciBridge5.functions = "8"
pciBridge6.present = "TRUE"
pciBridge6.virtualDev = "pcieRootPort"
pciBridge6.functions = "8"
pciBridge7.present = "TRUE"
pciBridge7.virtualDev = "pcieRootPort"
pciBridge7.functions = "8"
vmci0.present = "TRUE"
hpet0.present = "TRUE"
floppy0.present = "FALSE"
svga.vramSize = "8388608"
memSize = "1024"
powerType.powerOff = "default"
powerType.suspend = "default"
powerType.reset = "default"
tools.upgrade.policy = "manual"
sched.cpu.units = "mhz"
sched.cpu.affinity = "all"
sched.cpu.latencySensitivity = "normal"
vm.createDate = "1653290933578182"
scsi0.virtualDev = "pvscsi"
scsi0.present = "TRUE"
sata0.present = "TRUE"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.fileName = "vm_hw14.vmdk"
sched.scsi0:0.shares = "normal"
sched.scsi0:0.throughputCap = "off"
scsi0:0.present = "TRUE"
ethernet0.virtualDev = "vmxnet3"
ethernet0.networkName = "VM Network"
ethernet0.addressType = "vpx"
ethernet0.generatedAddress = "00:50:56:82:3b:12"
ethernet0.uptCompatibility = "TRUE"
ethernet0.present = "TRUE"
sata0:0.startConnected = "FALSE"
sata0:0.deviceType = "cdrom-raw"
sata0:0.clientDevice = "TRUE"
sata0:0.fileName = "emptyBackingString"
sata0:0.present = "TRUE"
displayName = "vm_hw14"
guestOS = "centos7-64"
toolScripts.afterPowerOn = "TRUE"
toolScripts.afterResume = "TRUE"
toolScripts.beforeSuspend = "TRUE"
toolScripts.beforePowerOff = "TRUE"
uuid.bios = "42 02 f4 0e 3a d6 e7 32-a6 a7 e8 31 10 89 91 02"
vc.uuid = "50 02 95 04 48 bf ff e8-b0 e5 48 50 6a 1c a1 8a"
migrate.hostLog = "vm_hw14-1eceb50f.hlog"
sched.cpu.min = "0"
sched.cpu.shares = "normal"
sched.mem.min = "0"
sched.mem.minSize = "0"
sched.mem.shares = "normal"
migrate.encryptionMode = "opportunistic"
~$
  1. vm_hw15 (hardware version 15)
    
    # Disk DescriptorFile
    version=1
    encoding="UTF-8"
    CID=fffffffe
    parentCID=ffffffff
    createType="vmfs"

Extent description

RW 32768 VMFS "vm_hw15-flat.vmdk"

The Disk Data Base

DDB

ddb.adapterType = "lsilogic" ddb.geometry.cylinders = "16" ddb.geometry.heads = "64" ddb.geometry.sectors = "32" ddb.longContentID = "8f9f61c18bf3b925b8dd9d06fffffffe" ddb.uuid = "60 00 C2 99 24 f5 07 1b-1c 62 c0 9c 93 f0 bd c2" ddb.virtualHWVersion = "14" ~$


```~$ cat vm_hw15.vmx 
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "15"
nvram = "vm_hw15.nvram"
pciBridge0.present = "TRUE"
svga.present = "TRUE"
pciBridge4.present = "TRUE"
pciBridge4.virtualDev = "pcieRootPort"
pciBridge4.functions = "8"
pciBridge5.present = "TRUE"
pciBridge5.virtualDev = "pcieRootPort"
pciBridge5.functions = "8"
pciBridge6.present = "TRUE"
pciBridge6.virtualDev = "pcieRootPort"
pciBridge6.functions = "8"
pciBridge7.present = "TRUE"
pciBridge7.virtualDev = "pcieRootPort"
pciBridge7.functions = "8"
vmci0.present = "TRUE"
hpet0.present = "TRUE"
floppy0.present = "FALSE"
svga.vramSize = "8388608"
memSize = "1024"
powerType.powerOff = "default"
powerType.suspend = "default"
powerType.reset = "default"
tools.upgrade.policy = "manual"
sched.cpu.units = "mhz"
sched.cpu.affinity = "all"
sched.cpu.latencySensitivity = "normal"
vm.createDate = "1653290989488198"
scsi0.virtualDev = "pvscsi"
scsi0.present = "TRUE"
sata0.present = "TRUE"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.fileName = "vm_hw15.vmdk"
sched.scsi0:0.shares = "normal"
sched.scsi0:0.throughputCap = "off"
scsi0:0.present = "TRUE"
ethernet0.virtualDev = "vmxnet3"
ethernet0.networkName = "VM Network"
ethernet0.addressType = "vpx"
ethernet0.generatedAddress = "00:50:56:82:66:4e"
ethernet0.uptCompatibility = "TRUE"
ethernet0.present = "TRUE"
sata0:0.startConnected = "FALSE"
sata0:0.deviceType = "cdrom-raw"
sata0:0.clientDevice = "TRUE"
sata0:0.fileName = "emptyBackingString"
sata0:0.present = "TRUE"
displayName = "vm_hw15"
guestOS = "centos7-64"
toolScripts.afterPowerOn = "TRUE"
toolScripts.afterResume = "TRUE"
toolScripts.beforeSuspend = "TRUE"
toolScripts.beforePowerOff = "TRUE"
uuid.bios = "42 02 45 2d 93 29 0c 44-3b a4 ac 79 57 05 3f 2a"
vc.uuid = "50 02 20 f3 ca 0e 7b f7-aa f0 9c b0 f8 35 e0 93"
migrate.hostLog = "vm_hw15-1eceb4ee.hlog"
sched.cpu.min = "0"
sched.cpu.shares = "normal"
sched.mem.min = "0"
sched.mem.minSize = "0"
sched.mem.shares = "normal"
migrate.encryptionMode = "opportunistic"
~$```
black13ua commented 2 years ago

vm_hw*-flat.vmdk its files with binary data:

~$ ls -l vm*
-rw-r--r-- 1 user user 16777216 May 23 07:30 vm_hw13-flat.vmdk
-rw-r--r-- 1 user user      441 May 23 07:30 vm_hw13.vmdk
-rw-r--r-- 1 user user     1999 May 23 10:30 vm_hw13.vmx
-rw-r--r-- 1 user user 16777216 May 23 07:31 vm_hw14-flat.vmdk
-rw-r--r-- 1 user user      441 May 23 07:31 vm_hw14.vmdk
-rw-r--r-- 1 user user     1999 May 23 10:31 vm_hw14.vmx
-rw-r--r-- 1 user user 16777216 May 23 07:31 vm_hw15-flat.vmdk
-rw-r--r-- 1 user user      441 May 23 07:31 vm_hw15.vmdk
-rw-r--r-- 1 user user     1999 May 23 10:31 vm_hw15.vmx
~$ file vm_hw13-flat.vmdk
vm_hw13-flat.vmdk: data
~$
gmoro commented 1 year ago

We plan to revamp the VMDK support in kiwi soon, this issue is important. We mostly test in ESX, but we now have access to a vSphere environment (not me directly) where we tested some of our new images. This issue relates to #2292 as vSphere is "better" at handling OVA files, making the use of the .vmx files less important. So I will try to get some commitment on our side to test the images every once in a while, at least, in the proprietary solutions.