Skip to content

VMware static IP metadata configuration #154

Open
@labserviceshslu

Description

@labserviceshslu

I am currently trying to get a working cloud-config metadata file for VMware to set a static IP. I am on v1.1.6 of cloudbase-init.

This is my metadata config:

#cloud-config
instance-id: test
local-hostname: test
admin-username: Admin
admin-password: Passw0rd
public-keys-data: ssh-ed25519 <key>
network:
  version: 2
  ethernets:
    Ethernet0:
      dhcp4: false
      addresses:
        - 10.0.0.10/24
      gateway4: 10.0.0.1
      nameservers:
        addresses:
          - 1.1.1.1
          - 1.0.0.1

My main question is about the "Ethernet0" part. In the example only matching the interface by MAC address is shown, however by cloud-init spec, matching the interface name directly (as shown above), matching the MAC and regex matching the name is supported.

Does cloudbase-init with the VMware metadata service only support matching by MAC address and would matching by name be something that could be added (if it isn't already)?

My use case is provisioning Windows VMs using terraform, so the metadata has to be generated/known at the same time as the VM is defined. I cannot wait for vSphere to assign a MAC address and then template the metadata after as metadata is written while the VM is created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions