Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get disk format from template on VMware, fixes bsc#1171349 #1093

Merged
merged 1 commit into from
Jun 23, 2020
Merged

Get disk format from template on VMware, fixes bsc#1171349 #1093

merged 1 commit into from
Jun 23, 2020

Conversation

spiarh
Copy link
Contributor

@spiarh spiarh commented May 7, 2020

Why is this PR needed?

Fixes https://bugzilla.suse.com/show_bug.cgi?id=1171349

What does this PR do?

This commit makes it possible to inherit the format of a disk from the template, before this, only
"Thin provision" templates could be cloned as these are the default terraform values.

  • Thick Provision Lazy Zeroed (default)
  • Thick Provision Eager Zeroed
  • Thin Provision

Signed-off-by: lcavajani lcavajani@suse.com

Info for QA

To use Thick Provisoning Lazy Zeroed (default)

  1. Create Template with Thick Provisoning Lazy Zeroed as format for the disk
  2. Clone from this template
$ INSTANCE_NAME="test-disks-lcava-master-0"
$ govc device.info -json=true -vm /PROVO/vm/$INSTANCE_NAME disk-1000-0 | jq '.Devices[].Backing | {ThinProvisioned, EagerlyScrub}'
{
  "ThinProvisioned": false,
  "EagerlyScrub": null
}

To use Thick Provisoning Eager Zeroed (default)

  1. Create Template with Thick Provisoning Eager Zeroed as format for the disk
  2. Clone from this template

⚠️ didn't show as eagerly scrubbed, need to investigate...

EDIT: I've found out we end up with lazy-zeroed when the size of the disk is changed, which is what we do, I've created an issue upstream: hashicorp/terraform-provider-vsphere#1078

If it's by design and not a bug, I will update the doc

$ INSTANCE_NAME="test-disks-lcava-master-0"
$ govc device.info -json=true -vm /PROVO/vm/$INSTANCE_NAME disk-1000-0 | jq '.Devices[].Backing | {ThinProvisioned, EagerlyScrub}'
{
  "ThinProvisioned": false,
  "EagerlyScrub": null
}

To use Thin Provisoning:

  1. Create Template with Thin Provisioning as format for the disk
  2. Clone from this template
$ INSTANCE_NAME="test-disks-lcava-master-0"
$ govc device.info -json=true -vm /PROVO/vm/$INSTANCE_NAME disk-1000-0 | jq '.Devices[].Backing | {ThinProvisioned, EagerlyScrub}'
{
  "ThinProvisioned": true,
  "EagerlyScrub": null
}

Status BEFORE applying the patch

It's not possible to use something else as the default Thin provisioning.

Status AFTER applying the patch

It's now possible to use the three formats above.

Docs

SUSE/doc-caasp#796

Merge restrictions

(Please do not edit this)

We are in v4-maintenance phase, so we will restrict what can be merged to prevent unexpected surprises:

What can be merged (merge criteria):
    2 approvals:
        1 developer: code is fine
        1 QA: QA is fine
    there is a PR for updating documentation (or a statement that this is not needed)

@innobead
Copy link
Contributor

innobead commented May 8, 2020

@spiarh
Copy link
Contributor Author

spiarh commented May 8, 2020

@spiarh spiarh changed the title [WIP] Add options to configure disk format on VMware, fixes bsc#1171349 Add options to configure disk format on VMware, fixes bsc#1171349 May 13, 2020
suseclee
suseclee previously approved these changes May 13, 2020
Copy link
Contributor

@suseclee suseclee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested results

image                                             template                                          VM
-----------------------------------------------------------------------------------------------------------------------------
lcavajani-guestinfo-nothin               Thick Provision Lazy Zeroed             Thick Provision Lazy Zeroed
lcavajani-guestinfo-nothin-eago          Thick Provision Eager Zeroed            Thick Provision Lazy Zeroed
Thick provisioned lazy zeroed: Both eagerly_scrub and thin_provisioned should be set to false.
Thick provisioned eager zeroed: eagerly_scrub should be set to true, and thin_provisioned should be set to false.
Thin provisioned: eagerly_scrub should be set to false, and thin_provisioned should be set to true.

lcavajani-guestinfo-nothin got

eagerly_scrub    = false
thin_provisioned = false

lcavajani-guestinfo-nothin-eago got

eagerly_scrub    = true
thin_provisioned = false

Vmware template default disk type cannot be changed as Ludo already mentioned about the bug. I feel like the VM is Thick Provision Eager Zeroed the last line of table because it took significantly took more time than layzy_zero or thin provisioning. I think that is because it is scrubbing old data. Anyway this is Terraform's bug as Ludo already mentioned the upstream issue in the bug.

It looks good to me.

jenting
jenting previously approved these changes May 14, 2020
@spiarh spiarh changed the title Add options to configure disk format on VMware, fixes bsc#1171349 Get disk format from template on VMware, fixes bsc#1171349 May 14, 2020
@spiarh
Copy link
Contributor Author

spiarh commented May 18, 2020

I still don't have an answer from upstream regarding Thick Provision Eager Zeroed so I have explained in the documentation how to proceed if one wants to use Thick Provision Eager Zeroed.

This is just to use the exact template size as values for master_disk_size and worker_disk_size.

This commit makes it possible to inherit the format
of a disk from the template, before this, only
"Thin provision" templates could be cloned as these
are the default terraform values.

* Thick Provision Lazy Zeroed (default)
* Thick Provision Eager Zeroed
* Thin Provision

Signed-off-by: lcavajani <lcavajani@suse.com>
@spiarh
Copy link
Contributor Author

spiarh commented Jun 22, 2020

This is ready for release.

@spiarh spiarh requested review from suseclee and jenting June 22, 2020 19:54
Copy link
Contributor

@suseclee suseclee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codes have not been changed a lot prior to my previous review.
LGTM

@c3y1huang c3y1huang merged commit c171885 into SUSE:master Jun 23, 2020
mmnelemane pushed a commit to mmnelemane/skuba that referenced this pull request Jul 3, 2020
This commit makes it possible to inherit the format
of a disk from the template, before this, only
"Thin provision" templates could be cloned as these
are the default terraform values.

* Thick Provision Lazy Zeroed (default)
* Thick Provision Eager Zeroed
* Thin Provision

Signed-off-by: lcavajani <lcavajani@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants