Provisioning from VMWare template deployed only as thick provisioned

Problem: Hosts deployed from Image based provisioning on VMWare are deployed as thick provisioned even though “Thin Provision” is selected.

I am currently trying to create new hosts based on a VMWare template, everything works ok so far (thanks to reading through a lot of topics in this community). The only issue I am having is that the host is created with a “Thick Provisioned Lazy Zeroed” disk, meanwhile I am selecting “Thin Provision” on the Virtual Machine tab under storage configuration.

Expected outcome:
New VM should be deployed with a thin provisioned disk.

Foreman and Proxy versions: 1.16.1

Foreman and Proxy plugin versions:
foreman_setup 5.0.0

Other relevant data:
Currently using VMWare vCenter, with a vSAN cluster. Hypervisors version: VMware ESXi, 6.5.0, 7388607

Please let me know what log files should I paste that might help.

Regards.

We are also experiencing this exact issue, when we mark the image deployment as “thin provisioned” we still get a thick provisioned VM.

Versions
Vmware VCenter Server 6.0.0
Foreman: 1.16.1

Hi,

Can I get a foreman-debug from your foreman-instance so I can look further. We do have an open BZ on that downstream but I swear that was fixed not too long ago. Maybe it was and there is regression now, either way email me a foreman-debug at chrobert@redhat.com

Hello,

I sent you the foreman-debug via email.

I should also note, that the same issue is present on a freshly installed 1.17 version, in this case the patches specified here: Bug #23378: Unable to create a VM on 1.17.0 on vCenter 6.5. - Foreman where applied.

Thank you very much for your support!

@ekonomi Hi,

Thank you for the email, sorry I was away the last few days travelling. I will start to work on this tomorrow for you.

Thank you!

Are you using VSAN too or just a normal datastore cluster?

I am using VSAN. I checked the storage policy and it is set to thin-provision. When I try to deploy the VM from the same template on vCenter the machine i get is thin-provisioned as expected.

Thank you for clarifying, @lukayeh are you using VSAN too?

Just for some additional clarification. I used the same foreman instance to provision on an other ESXI host which has a local datastore and got the same results.

Ok good to know it is not isolated to VSAN, I will try with localstorage. I am just getting an image spun up and created. I do not have a VSAN license so thank you for letting me know that.

@ekonomi

I tested this on foreman 1.15 with fog-vsphere 1.7.0 and it worked fine:

http://nimb.ws/7bPd2f

I am going to test with nightly and see if we have regression.

Thank you for your time cintrix84.

Let me know if you need any additional information from me.

Hi @ekonomi

I went ahead and built a host normally:

http://nimb.ws/grU8qG

I made sure to have the vm created with thick provisioning

http://nimb.ws/ZjXvNs

Sadly this does not look to be working, as you can see from here the vm is still in thin mode.

http://nimb.ws/LXzZlI

It looks like we are hitting this:

https://bugzilla.redhat.com/show_bug.cgi?id=1378579

Did it ever work for you?

I can pick up this bug and start to look at it if you wish?

I tested a thick prov template and trying to make a new thin vm with that and it didnt work either:

Template: http://nimb.ws/L6rIW3

Thin checked: http://nimb.ws/MsBumD

Thin result: http://nimb.ws/xNEbR4

I tested a thin template and was able to create a thick vm ok

Thin thick create: http://nimb.ws/FtvS7Z

Thick result: http://nimb.ws/EBNzbt

When I tried to create a thin vm from a thin template it did not honor it:

Thin create: http://nimb.ws/SibMkE

Thin result: http://nimb.ws/0P3wO1

Thank you for running the tests @cintrix84

I remember trying the PXE Mode installation and the image was deployed as Thin-Provision. I didnt try setting it as thick provisioned though.

Im not sure if Bug:1378579 is directly related to our issue, since it looks like it has the opposite outcome where the image is deployed as thin provisioned.

However I would really appreciate if you can pick up this bug.

Thank you very much @cintrix84, I really appreciate it!

Another data point here, I can confirm this problem also exists in 1.18. I am unable to deploy a VM template using image as thin when the template is thick.

Sorry for the long delay, I am finishing up 1 high priority bug for our downstream release and then will start to look at this more. I already have it assigned to me to look at.

Looks like I am impacted by this as well. Technically I’m running Satellite, but it worked correctly before a recent upgrade. I am going back through my recently provisioned hosts to try and figure out exactly when it stopped working correctly.

I upgraded to 1.20.1 and this problem went away. However, I am reasonably certain this was not related to the upgrade (could be wrong). My solution involved tweaking the POST for the VM creation to match the example someone provided in Bug #25093: Provisioning VMs with Foreman API Not Working for Multiple SCSI Controllers and Volumes - Hammer CLI - Foreman

The VM attributes are very picky about data entry. The exact before and after are below… and in my opinion… what I had before should have worked and it didn’t. Synopsis below,

What I had before,

                            "compute_attributes":

                            {

                                            "scsi_controllers":

                                            [

{ “type”:“VirtualLsiLogicController”, “key”:“1000” }
],

                                            "volumes_attributes":

                                            {

                                                            "0":

{ “thin”:1, “eagerZero”:0, “mode”:“persistent”, “controllerKey”:1000, “datastore”:“XXXXXX” }
}

                                            "start":"1",

                                            "image_id":"5034a01f-5f5c-7411-44f7-c3c3c66264ca",

                                            "cpus":"2","corespersocket":"1",

                                            "memory_mb":"4096",

                                            "firmware":"bios",

                                            "resource_pool":"foreman-temp",

                                            "hardware_version":"Default",

                                            "add_cdrom":"1",

                            }

What I changed it to,

“compute_attributes”: {

"start": "1",

"image_id": "5034a01f-5f5c-7411-44f7-c3c3c66264ca",

"cpus": "8",

"corespersocket": "1",

"memory_mb": "8192",

"firmware": "bios",

"resource_pool": "foreman-temp",

"hardware_version": "Default",

"add_cdrom": "0",

"scsi_controller_type": "ParaVirtualSCSIController",

"volumes_attributes": {

  "0":

{ “_delete”: “”, “datastore”: “XXXXXX”, “name”: “Hard disk 1”, “size_gb”: “150”, “thin”: “true”, “eagerZero”: “false” }
}

},

I upgraded to 1.20.1 today and nothing changed for me, a new VM from a thin provision image was created with lazy zeroed storage.
Can you explain your old workaround?
Thanks