Open severson-globus opened 3 years ago
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!
@waynew is this part if the salt-extension, or no?
Just bumping the status on this.
Eventually this functionality will be superseded by the extension module, will open an issue there to track it as well.
Description When creating a virtual machine using the vsphere6 module, the following error occurs during cloud.create:
A specified parameter was not correct: deviceChange[14].device.key (Cannot add multiple devices using the same device key..)
On subsequent deploys, the index changes to various different devices, or it may intermittently work and deploy a working VM.
Setup Example cloud.create runner:
Steps to Reproduce the behavior Run the above salt.runner, or create your own with many disks.
Expected behavior Virtual machine is created with all disks specified.
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.12.3 cherrypy: Not Installed dateutil: Not Installed docker-py: Not Installed gitdb: 4.0.7 gitpython: 3.1.18 Jinja2: 2.11.2 libgit2: 1.1.0 M2Crypto: 0.35.2 Mako: Not Installed msgpack: 0.6.2 msgpack-pure: Not Installed mysql-python: Not Installed pycparser: 2.19 pycrypto: Not Installed pycryptodome: Not Installed pygit2: 1.6.1 Python: 3.6.8 (default, Aug 7 2019, 17:28:10) python-gnupg: Not Installed PyYAML: 5.3.1 PyZMQ: 17.0.0 smmap: 4.0.0 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.1.4 System Versions: dist: centos 7 Core locale: UTF-8 machine: x86_64 release: 3.10.0-1062.9.1.el7.x86_64 system: Linux version: CentOS Linux 7 Core ```Additional context This appears to be a bug in the salt/cloud/clouds/vmware.py module. In it, instead of using code to create unique device keys for each disk, it uses the following:
By setting random_key in small int range, the liklihood of colliding IDs is increased. The code should be rewritten to keep track of ID's generated, and ensure that no two devices are assigned the same ID. This issue could impact ANY other device being added to a virtual machine, but is most likely with disks.
As a work around, I've inceased the random_key int range to :
This significantly decreases the liklihood of a collision, but it's still possible. The real fix would be to rewrite the ID generation code to use a 'base ID' for each device type, then increment by 1 for each device added in that type.