salt icon indicating copy to clipboard operation
salt copied to clipboard

[BUG] salt-cloud - proxmox driver - change / update the ip_address parameter to reflect its usage

Open cavepopo opened this issue 5 years ago • 3 comments

Description When using dhcp as network configuration mode for LXC provisioning the parameter ip_address needs to be set to the fqdn, therefore the parma name seems odd.

Setup Example of map file when using dhcp :

lxc-debian:
  - test-lxc.domain:
      ip_address: test-lxc.domain
      net0: name=eth0,bridge=vmbr0,ip=dhcp
      image: local:vztmpl/lxc-template-v1.1.tar.gz
  • [x] on-prem machine (on proxmox host)
  • [x] container (LXC through proxmox)

Steps to Reproduce the behavior Create a LXC using salt-cloud and proxmox driver

Expected behavior ip_address param to be renamed or at least documentation explicitly describes what this param is for in dhcp and fixed ip context

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3003.1
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: Not Installed
      dateutil: 2.7.3
     docker-py: Not Installed
         gitdb: 2.0.5
     gitpython: 2.1.11
        Jinja2: 2.10
       libgit2: 1.1.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 0.5.6
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.20
      pycrypto: 2.6.1
  pycryptodome: 3.6.1
        pygit2: 1.6.1
        Python: 3.7.3 (default, Jan 22 2021, 20:04:44)
  python-gnupg: Not Installed
        PyYAML: 3.13
         PyZMQ: 17.1.2
         smmap: 2.0.5
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.1
 
System Versions:
          dist: debian 10 buster
        locale: utf-8
       machine: x86_64
       release: 5.4.140-1-pve
        system: Linux
       version: Debian GNU/Linux 10 buster

cavepopo avatar Oct 27 '21 14:10 cavepopo

Actually the ip_address is not used in the API, and is completely ignored. So the above code does exactly the same as:

test-lxc.domain:
      net0: name=eth0,bridge=vmbr0,ip=dhcp
      image: local:vztmpl/lxc-template-v1.1.tar.gz

The hostname is derived from the name of the salt resource being created, which is whatever is used on the salt-cloud command line.

mthibaut avatar May 06 '23 14:05 mthibaut

Thanks for the follow up

cavepopo avatar May 06 '23 18:05 cavepopo

This should be left open until the documentation is fixed. Also I found that this parameter is not actually unused. While unused in the API it is used by the salt proxmox code to determine the hostname to SSH to.

This means the current naming of the parameter is confusing, something like "ssh_host" would be more appropriate and in line with the existing ssh_username etc parameters. Also the parameters used to call the API should be separated more clearly from those used to configure the machine post-install.

Copied this to https://github.com/salt-extensions/saltext-proxmox/issues/9

mthibaut avatar May 10 '23 21:05 mthibaut