AlmaLinux / cloud-images

Packer templates and other tools for building AlmaLinux images for various cloud platforms.
MIT License
161 stars 48 forks source link

open-vm-tools not running using generic cloud image with vsphere #189

Closed Keltirion closed 1 month ago

Keltirion commented 3 months ago

I'm trying to use Alma 9.4 (same for Alma 8) Generic cloud image with vsphere and cloud-init but when i create sample vm seems like open-vm-tools is not running? My vsphere version is 7.0.3.01900

obraz

I'm passing cloud-init configuration with terraform but it does not work. Am I doing something wrong here? I can see it being added to the VM

  extra_config = {
    "guestinfo.metadata" = base64encode(file(local.vm_meta_config))
    "guestinfo.metadata.encoding" = "base64"
    "guestinfo.userdata" = data.cloudinit_config.main.rendered
    "guestinfo.userdata.encoding" = "base64"
  }

and the contents are correct

obraz
LKHN commented 2 months ago

Hi Lech,

The open-vm-tools is excluded on the kickstart files of Generic Cloud images and is not installed by the Ansible packer provisioner. So, it is expected to not have it installed at all.

Can you build the image from the sources by commenting the line that open-vm-tools excluded and add it to the list of installed packages?

Currently, I don't have any access to VMWare vSphere to try to reproduce the issue related to Cloud-init at the moment.

Keltirion commented 1 month ago

Hi i did create my own custom version with Packer and open-vm-tools now everything works.

LKHN commented 1 month ago

@Keltirion ,

Thanks for the feedback. Can we say that including only open-vm-tools package is enough to make Generic Cloud compatible with VMware vSphere? Can you share which else changes you have to made to make it work?

Keltirion commented 1 month ago

@LKHN I think so, I've used standard alma linux image not the generic cloud one, using kickstart i did the instalation of open-vm-tools and some config. AFIK open-vm-tools is need to report back to vsphere packer provisioner the ip of vm after first install. After that rest works fine.