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

salt-cloud VMware IPv6 and/or multiple IPs #51275

Open
Marx1st opened this issue Jan 22, 2019 · 5 comments
Open

salt-cloud VMware IPv6 and/or multiple IPs #51275

Marx1st opened this issue Jan 22, 2019 · 5 comments
Labels
Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Feature new functionality including changes to functionality and code refactors, etc.
Milestone

Comments

@Marx1st
Copy link

Marx1st commented Jan 22, 2019

I constantly deploy new VMs on our vSphere cluster using salt-cloud. For this I clone an existing vm and define the ip in a .conf file.

Our networking department always provides both an IPv4 and an IPv6 address for new servers.

The profile files for salt-cloud and VMWare only support one IP per nic, but I would like to add both IPv4 and IPv6 address to a single nic in the vm.

Setup

devices: network: Network adapter 1: name: "dPG name (424)" dvs_switch: "DSwitch name zentral" switch_type: distributed adapter_type: vmxnet3 ip: 132.xxx.xxx.xxx gateway: [132.xxx.xxx.xxx] subnet_mask: 255.255.255.192

` # salt --versions-report
Salt Version:
Salt: 2018.3.3

Dependency Versions:
cffi: 0.8.6
cherrypy: Not Installed
dateutil: 2.2
docker-py: Not Installed
gitdb: 0.5.4
gitpython: 0.3.2 RC1
ioflo: Not Installed
Jinja2: 2.9.4
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.2
mysql-python: Not Installed
pycparser: 2.10
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.9 (default, Sep 25 2018, 20:42:16)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 14.4.0
RAET: Not Installed
smmap: 0.8.2
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5

System Versions:
dist: debian 8.11
locale: UTF-8
machine: x86_64
release: 3.16.0-7-amd64
system: Linux
version: debian 8.11 `

@garethgreenaway garethgreenaway added this to the Approved milestone Jan 23, 2019
@garethgreenaway garethgreenaway added the Feature new functionality including changes to functionality and code refactors, etc. label Jan 23, 2019
@garethgreenaway
Copy link
Contributor

@Marx1st Thanks for the report. I do not believe this is supported at the moment but would definitely be a good addition. I'm approving it for a future feature addition.

@deput-d
Copy link

deput-d commented Sep 20, 2019

Is this a far in the future feature request or something we might be able to see soon?

@stale
Copy link

stale bot commented Jan 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Jan 7, 2020
@sagetherage sagetherage added the Confirmed Salt engineer has confirmed bug/feature - often including a MCVE label Jan 9, 2020
@stale
Copy link

stale bot commented Jan 9, 2020

Thank you for updating this issue. It is no longer marked as stale.

@stale stale bot removed the stale label Jan 9, 2020
@ggiesen
Copy link
Contributor

ggiesen commented May 14, 2022

@Marx1st, @deput-d if your VMs have both VMware tools (to pass metadata from vSphere to the VM) and cloud-init (to read the metadata and apply the configuration) installed in your VM templates, you can configure IPv4 normally, and pass the IPv6 configuration through guestinfo.metadata and cloud-init will configure the IPv6 networking for you.

An example of a cloud.present state:

# Create example01 VM
cloud_example01:
  cloud.present:
    - name: "example01.example.com"
    - cloud_provider: vcenter01
    - clonefrom: AlmaLinux_8.5_x64_Template_cloud-init-1.0.2
    - num_cpus: 2
    - memory: 8GB
    - devices:
        disk:
          Hard disk 1:
            size: 50
            controller: SCSI controller 0
            thin_provision: True
        network:
          Network adapter 1:
            name: VL1518-EXAMPLE
            adapter_type: vmxnet3
            switch_type: distributed
            ip: 192.0.2.52
            gateway: [192.0.2.49]
            subnet_mask: 255.255.255.240
    - domain: example.com
    - dns_servers:
        - 198.51.100.2
        - 198.51.100.3
    - datastore: DATASTORE
    - folder: Internal
    - datacenter: DC
    - resourcepool: Resources
    - host: hv01
    - template: False
    - power_on: True
    - extra_config:
        # This is cloud-init customization data
{% set metadata = 
'local-hostname: example01.example.com
instance-id: example01.example.com
network:
  version: 2
  ethernets:
    ens192:
      addresses:
        - 192.0.2.52/28
        - 2001:db8:1518::11/64
      gateway4: 192.0.2.49
      gateway6: 2001:db8:1518::1
      nameservers:
        search: [example.com]
        addresses: [198.51.100.2, 198.51.100.3]
' %}
        guestinfo.metadata: {{ metadata | base64_encode }}
        guestinfo.metadata.encoding: base64
        mem.hotadd: 'yes'
    - annotation: Created by Salt-Cloud
    - deploy: True
    - minion:
        id: example01
        master: 192.0.2.20
    - customization: False
    - ssh_username: root
    - password: CorrectHorseBatteryStaple
    - delvol_on_destroy: True

Be sure that customization: False is set, otherwise cloud-init will fight with VMware tools to configure the NIC. The format of the cloud-init metadata for network is documented here:

https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Feature new functionality including changes to functionality and code refactors, etc.
Projects
None yet
Development

No branches or pull requests

5 participants