Skip to content

vmware: Support cloud-init datasource GuestInfo#290

Merged
gehoern merged 1 commit into
gardenlinux:mainfrom
akutz:feature/vmware-cloud-init-datasource-guestinfo
Sep 27, 2021
Merged

vmware: Support cloud-init datasource GuestInfo#290
gehoern merged 1 commit into
gardenlinux:mainfrom
akutz:feature/vmware-cloud-init-datasource-guestinfo

Conversation

@akutz
Copy link
Copy Markdown
Contributor

@akutz akutz commented Jul 18, 2021

How to categorize this PR?

/kind enhancement
/area os
/os garden-linux

What this PR does / why we need it:
This patch adds support for the Cloud-Init Datasource, VMwareGuestInfo, to the VMware image. The files in this commit were copied from release v1.4.1 of the datasource from https://github.com/vmware/cloud-init-vmware-guestinfo.

The datasource has a dependency on the netifaces library, and so the package python3-netifaces was added to the package file for the vmware image.

The patch was verified by:

  1. Building the VMware image:

    make vmware
  2. Verifying the cloud-init datasource's files were copied into the image correctly:

    $ tar vtf .build/vmware/20210718/amd64/bullseye/rootfs.tar.xz | grep 'DataSourceVMware\|dscheck_VMware'
    -rw-rw-r-- 0/0             549 2021-07-18 00:00 etc/cloud/cloud.cfg.d/99-DataSourceVMwareGuestInfo.cfg
    -rwxr-xr-x 0/0            2078 2021-07-18 00:00 usr/bin/dscheck_VMwareGuestInfo.sh
    -rw-rw-r-- 0/0           25937 2021-07-18 00:00 usr/lib/python3/dist-packages/cloudinit/sources/DataSourceVMwareGuestInfo.py

    Please note the file dscheck_VMwareGuestInfo.sh maintains its necessary, executable permissions.

  3. Verifying the python3-netifaces package was installed correctly:

    $ tar vtf .build/vmware/20210718/amd64/bullseye/rootfs.tar.xz | grep 'netifaces'
    drwxr-xr-x 0/0               0 2021-07-18 00:00 usr/lib/python3/dist-packages/netifaces-0.10.9.egg-info/
    -rw-r--r-- 0/0           10291 2020-12-08 01:16 usr/lib/python3/dist-packages/netifaces-0.10.9.egg-info/PKG-INFO
    -rw-r--r-- 0/0               1 2020-12-08 01:16 usr/lib/python3/dist-packages/netifaces-0.10.9.egg-info/dependency_links.txt
    -rw-r--r-- 0/0              10 2020-12-08 01:16 usr/lib/python3/dist-packages/netifaces-0.10.9.egg-info/top_level.txt
    -rw-r--r-- 0/0               1 2018-05-02 09:15 usr/lib/python3/dist-packages/netifaces-0.10.9.egg-info/zip-safe
    -rw-r--r-- 0/0           23104 2020-12-08 01:16 usr/lib/python3/dist-packages/netifaces.cpython-39-x86_64-linux-gnu.so
    drwxr-xr-x 0/0               0 2021-07-18 00:00 usr/share/doc/python3-netifaces/
    -rw-r--r-- 0/0            1451 2018-04-02 20:08 usr/share/doc/python3-netifaces/copyright
    -rw-r--r-- 0/0             736 2021-07-18 00:00 var/lib/dpkg/info/python3-netifaces.list
    -rw-r--r-- 0/0             852 2020-12-08 01:16 var/lib/dpkg/info/python3-netifaces.md5sums

Which issue(s) this PR fixes:
Fixes NA

Special notes for your reviewer:

  • This PR was initiated in conjunction with @marwinski .
  • Please note this patch could be implemented by leveraging features/vmware/exec.confg instead of copying static files. This is the process used by the kube-image-builder project. However, a network-based, dynamic install is less deterministic than copying a few static files, so the latter method was used.
  • Additionally, I initially had several issues building the image locally in a Linux VM. The root cause ended up being insufficient RAM for the VM. It had 4GiB, and I had to increase it to 8GiB for the image to build successfully.

Release note:

Support for the Cloud-Init datasource VMwareGuestInfo in the VMware image

@akutz akutz requested a review from a team as a code owner July 18, 2021 18:53
@ghost ghost added area/os enhancement Enhancement, improvement, extension labels Jul 18, 2021
@ghost
Copy link
Copy Markdown

ghost commented Jul 18, 2021

@akutz Thank you for your contribution.

@ghost ghost added needs/review Needs review size/xl labels Jul 18, 2021
@marwinski
Copy link
Copy Markdown
Contributor

Thanks @akutz! Are you sure this does will break the existing vSphere 7.0 use case?

@akutz
Copy link
Copy Markdown
Contributor Author

akutz commented Jul 19, 2021

Thanks @akutz! Are you sure this does will break the existing vSphere 7.0 use case?

Are you asking if I'm sure this won't break the existing 7.0 image?

If so, then no, I've not tested the image. You should do that yourself prior to merging this PR. What I am sure of is this PR solves the issue encountered with the cloud-init userdata example provided in that e-Mail thread.

Copy link
Copy Markdown
Contributor

@marwinski marwinski left a comment

Choose a reason for hiding this comment

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

We haven't checked VMwareGuestInfo yet.

@ghost ghost added the needs/changes label Jul 21, 2021
Copy link
Copy Markdown
Contributor

@marwinski marwinski left a comment

Choose a reason for hiding this comment

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

we had to rename features/vmware/file.include/usr/bin/dscheck_VMwareGuestInfo.sh to features/vmware/file.include/usr/bin/dscheck_VMwareGuestInfo. With this it worked for both environments.

@akutz
Copy link
Copy Markdown
Contributor Author

akutz commented Jul 21, 2021

we had to rename features/vmware/file.include/usr/bin/dscheck_VMwareGuestInfo.sh to features/vmware/file.include/usr/bin/dscheck_VMwareGuestInfo. With this it worked for both environments.

Ack. I'll submit the changes to the PR ASAP

@ghost
Copy link
Copy Markdown

ghost commented Jul 24, 2021

@akutz You have pull request review with status CHANGES_REQUESTED, please check

@akutz akutz force-pushed the feature/vmware-cloud-init-datasource-guestinfo branch from 0b79853 to dcfe3f0 Compare August 11, 2021 16:51
This patch adds support for the Cloud-Init Datasource,
VMwareGuestInfo, to the VMware image. The files in this
commit were copied from release v1.4.1 of the datasource
from https://github.com/vmware/cloud-init-vmware-guestinfo.

The datasource has a dependency on the netifaces library,
and so the package python3-netifaces was added to the package
file for the vmware image.
@akutz akutz force-pushed the feature/vmware-cloud-init-datasource-guestinfo branch from dcfe3f0 to 60ad41f Compare August 11, 2021 16:51
@akutz
Copy link
Copy Markdown
Contributor Author

akutz commented Aug 11, 2021

Both changes are now applied. Please note that this datasource will become a standard part of cloud-init in 21.3 (canonical/cloud-init#953).

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 4, 2021

CLA assistant check
All committers have signed the CLA.

@marwinski marwinski added this to the 2021-Q3 milestone Sep 7, 2021
@marwinski
Copy link
Copy Markdown
Contributor

Hi @akutz. Thanks for the changes and sorry for the delay. We would like to include this in the upcoming Garden Linux release next week. Could you sign the contributor license agreement so that we can go ahead. Thanks.

@akutz
Copy link
Copy Markdown
Contributor Author

akutz commented Sep 20, 2021

Hi @akutz. Thanks for the changes and sorry for the delay. We would like to include this in the upcoming Garden Linux release next week. Could you sign the contributor license agreement so that we can go ahead. Thanks.

Done and done!

@akutz
Copy link
Copy Markdown
Contributor Author

akutz commented Sep 20, 2021

FYI @marwinski, I'm not sure on which Debian release Gardener Linux is based, but Debian Bookworm and Sid both have Cloud-Init v21.3. Since Bookworm is the next release for Debian, I imagine you will be able to take advantage of the Cloud-Init DataSource for VMware soon.

@akutz
Copy link
Copy Markdown
Contributor Author

akutz commented Sep 20, 2021

@marwinski The GitHub check above says I've not yet signed the CLA when I clearly have signed the CLA:

image

@gehoern gehoern merged commit 62eb2f9 into gardenlinux:main Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement, improvement, extension needs/review Needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants