linuxkit icon indicating copy to clipboard operation
linuxkit copied to clipboard

added vmware metadata provider, closes #3507

Open brlbil opened this issue 4 years ago • 25 comments

cloud-init data from vmware guest info as it described in the link below https://github.com/vmware/cloud-init-vmware-guestinfo

closes #3507

- What I did Implemented a vmware metadata provider that leverages vmware guest info - How I did it Implemented Provider interface. Added provider_vmware file and added vmware to cdrom providers in main.go - How to verify it Guest info can be set for a vm using govc tool and can be tested in that vm as described. https://github.com/vmware/cloud-init-vmware-guestinfo - Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

brlbil avatar May 15 '20 14:05 brlbil

I know it took a lot of time to fix missing bits and pieces. It seems all the checks are passing now, so can we merge this now? @rn

brlbil avatar Feb 05 '21 12:02 brlbil

I know everyone is busy and it is not realistic to expect things always go fast for opensource projects. But I would like to see this included in k3os asap. So can anyone take a look at the PR and get it rolling, please?

brlbil avatar Feb 15 '21 10:02 brlbil

I know everyone is busy and it is not realistic to expect things always go fast for opensource projects. But I would like to see this included in k3os asap. So can anyone take a look at the PR and get it rolling, please?

A bit off-topic; I built k3os image with this your merge request and deployed it to VMware virtual datacenter using vcloud director, so thanks for this patch!

But for some reason my k3os installation on latest version of VMware cloud director wasn't able to read 'vmware' provider. On boot K3OS wasn't able to read guest-properties that I had added('guestinfo.user-data') and gave me just message "No metadata/userdata found. Bye".

Have you got this provider working? If yes, with what platform and which guest-properties?

voima-eetu avatar Feb 16 '21 10:02 voima-eetu

As you said I am sure we should discuss these issues here either. I think the problem is key should be set as guestinfo.userdata not guestinfo.user-data

brlbil avatar Feb 16 '21 13:02 brlbil

What's blocking this to be merged?

edvinerikson avatar May 07 '21 12:05 edvinerikson

Any updates to this?

thehedgefrog avatar Oct 19 '21 19:10 thehedgefrog

Also looking for an update on this. Any thoughts? @rn

observ3r avatar Oct 25 '21 10:10 observ3r

Any updates to this?

chris93111 avatar Nov 17 '21 19:11 chris93111

Hello @rn - could you review/approve this?

observ3r avatar Feb 02 '22 20:02 observ3r

@deitch Could you take a look at this?

observ3r avatar Mar 09 '22 23:03 observ3r

This looks pretty good, and you did address @rn's comments.

The only questions I have are:

  1. Can you get @robertkaelin 's proposed changes here in, so that you do not have the dependency on vmware-rpctool? That would also mean documenting it, showing how to ensure it is available, etc. etc. His library solution is much better.
  2. Is there any way to add a test for this? We only have a test for metadata on a CD here, so I can hardly be a stickler for it, but if it is possible, it would be good.

deitch avatar Mar 10 '22 15:03 deitch

Completely separately, I see several people interested here. How are you using this (linuxkit in general)?

deitch avatar Mar 10 '22 15:03 deitch

@deitch originally I open this PR because linuxkit's metadata package is used in k3os

When it comes to your questions,

  1. Changes suggested by @robertkaelin make sense I can add them. In fact, we have been running a forked version of the metadata package with these changes for some time now.
  2. If we do the changes to use the VMware library then I do not know how can we add tests for it. It is meant to be run in a VMware virtual env. If it is run any other env it panics.

Since there is an interest I will make the changes and push them.

brlbil avatar Mar 10 '22 15:03 brlbil

Go for it.

And when done, please squash all of your commits.

deitch avatar Mar 10 '22 15:03 deitch

Completely separately, I see several people interested here. How are you using this (linuxkit in general)?

I'm using K3os in a homelab environment. I deploy Packer images with Terraform, so the quick and easy way is to use the provider.

My current workaround is to use the File provisioner to write a config file at deployment, that K3os then loads to configure. This however does not leverage the capabilities of cloud-init.

thehedgefrog avatar Mar 10 '22 15:03 thehedgefrog

I do not have access to a vcenter currently, so I will test the latest changes next week just to make sure everything works as expected.

brlbil avatar Mar 11 '22 12:03 brlbil

@deitch I have tested the package on a VMWare VM, and it works as expected. Also, rebase and squash my commits as requested.

brlbil avatar Mar 15 '22 13:03 brlbil

Looks fine to me. Let CI go green and we can merge in.

deitch avatar Mar 21 '22 15:03 deitch

I just remembered, we need to build and push out the updated images, then run the script.

scripts/update-components-sha.sh --image $(linuxkit package show-tag pkg/metadata)

That can be a separate commit.

Either way, though, CI is failing. Can you see what is causing it?

deitch avatar Mar 21 '22 15:03 deitch

@brlbil Any update on this? Really looking forward to configure k3os on vSphere without having to keep open a fork of linuxkit and build it every time I want a new ISO.

KittyKatt avatar May 09 '22 05:05 KittyKatt

@KittyKatt Unfortunately, I do not have any spare time to track the error that the pipeline throws. I have to do this on my own time. If anyone can help to track the error in the pipeline I would appreciate it.

brlbil avatar May 09 '22 08:05 brlbil

Appears the logs have expired for the Action that failed. Could it be re-run?

observ3r avatar Jul 19 '22 18:07 observ3r

@brlbil @deitch I don't have permission to rerun looks like. Could someone rerun it to generate the logs of the failed job?

observ3r avatar Jul 25 '22 11:07 observ3r

@observ3r I cannot run them either.

brlbil avatar Jul 25 '22 11:07 brlbil

@KittyKatt Unfortunately, I do not have any spare time to track the error that the pipeline throws. I have to do this on my own time. If anyone can help to track the error in the pipeline I would appreciate it.

I tried looking into the errors when it was available and correcting/building locally, but unfortunately I am not anywhere near an expert in Go and couldn't make heads nor tails of it. Sorry!

KittyKatt avatar Aug 11 '22 17:08 KittyKatt

Hey @deitch , are you able to rerun it?

observ3r avatar Nov 29 '22 17:11 observ3r

The rerun button isn't there. 🤷‍♂️

Might as well rebase it to get the parallelization we did for actions (runs much more quickly), and push it out, which will cause CI to kick off again anyways.

deitch avatar Nov 30 '22 18:11 deitch

Oh awesome, lookin good! I suppose just waiting on @rn at this point?

observ3r avatar Dec 07 '22 23:12 observ3r

@brlbil Wanna rebase it? I don't think I can

observ3r avatar Mar 02 '23 19:03 observ3r

@observ3r @deitch I rebased, but I think the workflow requires approval

brlbil avatar Mar 03 '23 12:03 brlbil