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

[BUG] proxmox salt-cloud driver fails to configure a cloned VM with all specified parameters #62580

Closed
pjcreath opened this issue Aug 30, 2022 · 0 comments · Fixed by #62559
Closed
Labels
Bug broken, incorrect, or confusing behavior needs-triage Salt-Cloud

Comments

@pjcreath
Copy link
Contributor

Description
When attempting to clone a qemu VM on a Proxmox VE host, the salt-cloud proxmox driver only configures ide/sata/scsi/net parameters.

It neglects to pass all other parameters, such as name, description, memory, number of cores, SSH keys, etc.

Pull request with fix and tests to follow.

Setup

  • salt master (hostname "salt") is running in a container on the Proxmox host.
  • Proxmox (hostname "pve") is running on bare metal, on-premises.
/etc/salt/cloud.providers.d/proxmox.conf
proxmox:
  minion:
    master: salt
  user: mysaltuser@pve
  password: notreallythepassword
  url: pve
  driver: proxmox
/etc/salt/cloud.profiles.d/proxmox.conf
ol8:
  provider: proxmox
  pool: mypool
  technology: qemu
  image: ''  # work around bug in salt
  clone: True
  clone_full: 0
  clone_from: 200
  host: pve
  onboot: 1
  sshkeys: mypubkey
  cores: 1
  net0: model=virtio,bridge=vmbr0
cloud.map
ol8:
  - testvm:
      vmid: 300

Steps to Reproduce the behavior
salt-cloud -l all -m cloud.map testvm

Excerpt of debug log
...
[DEBUG   ] Host has been created!
[INFO    ] Configuring cloned VM
[DEBUG   ] get: https://pve:8006/api2/json/nodes/pve/qemu/300/config (None)
[DEBUG   ] Starting new HTTPS connection (1): pve:8006
[DEBUG   ] https://pve:8006 "GET /api2/json/nodes/pve/qemu/300/config HTTP/1.1" 200 944
[DEBUG   ] post: https://pve:8006/api2/json/nodes/pve/qemu/300/config ({'net0': 'model=virtio,bridge=vmbr0'})
[DEBUG   ] Starting new HTTPS connection (1): pve:8006
[DEBUG   ] https://pve:8006 "POST /api2/json/nodes/pve/qemu/300/config HTTP/1.1" 200 75
[DEBUG   ] Start: testvm (300) = Start
...

Expected behavior
Configuring all valid VM parameters specified in the profile or cloud map

Expected excerpt of debug log
...
[DEBUG   ] Host has been created!
[INFO    ] Configuring cloned VM
[DEBUG   ] post: https://pve:8006/api2/json/nodes/pve/qemu/300/config ({'onboot': 1})
[DEBUG   ] Starting new HTTPS connection (1): pve:8006
[DEBUG   ] https://pve:8006 "POST /api2/json/nodes/pve/qemu/300/config HTTP/1.1" 200 75
[DEBUG   ] post: https://pve:8006/api2/json/nodes/pve/qemu/300/config ({'sshkeys': 'mypubkey'})
[DEBUG   ] Starting new HTTPS connection (1): pve:8006
[DEBUG   ] https://pve:8006 "POST /api2/json/nodes/pve/qemu/300/config HTTP/1.1" 200 75
[DEBUG   ] get: https://pve:8006/api2/json/nodes/pve/qemu/300/config (None)
[DEBUG   ] Starting new HTTPS connection (1): pve:8006
[DEBUG   ] https://pve:8006 "GET /api2/json/nodes/pve/qemu/300/config HTTP/1.1" 200 1028
[DEBUG   ] post: https://pve:8006/api2/json/nodes/pve/qemu/300/config ({'net0': 'model=virtio,bridge=vmbr0'})
[DEBUG   ] Starting new HTTPS connection (1): pve:8006
[DEBUG   ] https://pve:8006 "POST /api2/json/nodes/pve/qemu/300/config HTTP/1.1" 200 75
[DEBUG   ] post: https://pve:8006/api2/json/nodes/pve/qemu/300/config ({'cores': 1})
[DEBUG   ] Starting new HTTPS connection (1): pve:8006
[DEBUG   ] https://pve:8006 "POST /api2/json/nodes/pve/qemu/300/config HTTP/1.1" 200 75
[DEBUG   ] post: https://pve:8006/api2/json/nodes/pve/qemu/300/config ({'name': 'testvm'})
[DEBUG   ] Starting new HTTPS connection (1): pve:8006
[DEBUG   ] https://pve:8006 "POST /api2/json/nodes/pve/qemu/300/config HTTP/1.1" 200 75
[DEBUG   ] Start: testvm (300) = Start
...

Versions Report

salt --versions-report
Salt Version:
          Salt: 3004.1
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.6.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10.1
       libgit2: Not Installed
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: Not Installed
        pygit2: Not Installed
        Python: 3.6.8 (default, Apr 11 2022, 08:25:52)
  python-gnupg: 0.4.6
        PyYAML: 3.12
         PyZMQ: 19.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: oracle 8.6 
        locale: UTF-8
       machine: x86_64
       release: 5.15.35-3-pve
        system: Linux
       version: Oracle Linux Server 8.6  
@pjcreath pjcreath added Bug broken, incorrect, or confusing behavior needs-triage labels Aug 30, 2022
pjcreath added a commit to pjcreath/salt that referenced this issue Aug 30, 2022
Ch3LL pushed a commit that referenced this issue Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage Salt-Cloud
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants