Parallel VM Deployment is failing for VMware Driver
Description of Issue/Question
Unable to do parallel VM deployment one after other with different cloud provider and profile , as one VM profile create and other VM profile is failed with following error:
salt.loaded.int.clouds.vmware: 2016-04-05 16:02:03,076 INFO [ VM1] Waiting to retrieve IPv4 information [30 s]
salt.loaded.int.clouds.vmware: 2016-04-05 16:02:03,109 INFO [ VM1] Successfully retrieved IPv4 information in 30 seconds
salt.loaded.int.clouds.vmware: 2016-04-05 16:02:03,119 INFO [ VM1 ] IPv4 is: 10.XX.XX.XX
salt.cloud: 2016-04-05 16:02:03,120 ERROR Failed to create VM VM-1. Configuration value 'vmprofile1' needs to be set
Traceback (most recent call last):
File "/tmp/test/test-dev/local/lib/python2.7/site-packages/salt-2016.3.0-py2.7.egg/salt/cloud/__init__.py", line 1280, in create
output = self.clouds[func](vm_)
File "/tmp/test/test-dev/local/lib/python2.7/site-packages/salt-2016.3.0-py2.7.egg/salt/cloud/clouds/vmware.py", line 2547, in create
out = salt.utils.cloud.bootstrap(vm_, __opts__)
File "/tmp/test/test-dev/local/lib/python2.7/site-packages/salt-2016.3.0-py2.7.egg/salt/utils/cloud.py", line 300, in bootstrap
vm_, opts, default=False)
File "/tmp/test/test-dev/local/lib/python2.7/site-packages/salt-2016.3.0-py2.7.egg/salt/config/__init__.py", line 2588, in get_cloud_config_value
if name in opts['profiles'][vm_['profile']]:
Setup
$cat /etc/salt/cloud.providers
provider1:
driver: vmware
password: <password>
port: 443
protocol: https
url: <vcenter-ip>
user: <vcenter-user>
provider2:
driver: vmware
password: <password>
port: 443
protocol: https
url: <vcenter-ip>
user: <vcenter-user>
$cat /etc/salt/cloud.profiles
profile1:
provider: provider1
clonefrom: Win2008R2
num_cpus: 4
memory: 8GB
datastore: Test-cntr0
cluster: Test-Cluster
folder: Test-VMs
domain: test.com
devices:
disk:
Hard disk 1:
size: 5
Hard disk 2:
size: 2
scsi:
SCSI controller 1:
type: lsilogic
SCSI controller 2:
type: lsilogic_sas
bus_sharing: virtual
SCSI controller 3:
type: paravirtual
profile2:
provider: provider2
clonefrom: Win2008R2
num_cpus: 4
memory: 8GB
datastore: Test-cntr0
cluster: Test-Cluster
folder: Test-VMs
domain: test.com
devices:
disk:
Hard disk 1:
size: 5
Hard disk 2:
size: 2
scsi:
SCSI controller 1:
type: lsilogic
SCSI controller 2:
type: lsilogic_sas
bus_sharing: virtual
SCSI controller 3:
type: paravirtual
Steps to Reproduce Issue
I am trying to do below steps programmatically
- Update Cloud provider and profile with
provider1andprofile1respectively and executesalt-cloud -p profile1 VM-1 - Simultaneous append Cloud provider and profile with
provider2andprofile2respectively and executesalt-cloud -p profile2 VM-2
VM VM-2 will bootstrap but unable to bootstrap VM-1 , giving following error:
salt.loaded.int.clouds.vmware: 2016-04-05 16:02:03,076 INFO [ VM1] Waiting to retrieve IPv4 information [30 s]
salt.loaded.int.clouds.vmware: 2016-04-05 16:02:03,109 INFO [ VM1] Successfully retrieved IPv4 information in 30 seconds
salt.loaded.int.clouds.vmware: 2016-04-05 16:02:03,119 INFO [ VM1 ] IPv4 is: 10.XX.XX.XX
salt.cloud: 2016-04-05 16:02:03,120 ERROR Failed to create VM VM-1. Configuration value 'vmprofile1' needs to be set
Traceback (most recent call last):
File "/tmp/test/test-dev/local/lib/python2.7/site-packages/salt-2016.3.0-py2.7.egg/salt/cloud/__init__.py", line 1280, in create
output = self.clouds[func](vm_)
File "/tmp/test/test-dev/local/lib/python2.7/site-packages/salt-2016.3.0-py2.7.egg/salt/cloud/clouds/vmware.py", line 2547, in create
out = salt.utils.cloud.bootstrap(vm_, __opts__)
File "/tmp/test/test-dev/local/lib/python2.7/site-packages/salt-2016.3.0-py2.7.egg/salt/utils/cloud.py", line 300, in bootstrap
vm_, opts, default=False)
File "/tmp/test/test-dev/local/lib/python2.7/site-packages/salt-2016.3.0-py2.7.egg/salt/config/__init__.py", line 2588, in get_cloud_config_value
if name in opts['profiles'][vm_['profile']]:
Versions Report
Salt Version:
Salt: 2016.3.0
Dependency Versions:
Jinja2: 2.8
M2Crypto: Not Installed
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
Python: 2.7.9 (default, Mar 1 2015, 12:57:24)
RAET: Not Installed
Tornado: 4.3
ZMQ: 4.0.5
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.7
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: debian 8.3
machine: x86_64
release: 3.10.0-229.20.1.el7.x86_64
system: Linux
version: debian 8.3
@anandxoriant, thanks for reporting. The stack trace you have pasted looks incomplete, are there more lines that you could include?
Ping @nmadhok
@anandxoriant I'm confused what you are trying to do here. There is already the ability to create VM's in parallel using the -P option (https://docs.saltstack.com/en/latest/ref/cli/salt-cloud.html).
I'm guessing the two providers you specified are both pointing to different vcenters? I noticed that both the specified profiles use the same provider (provider2). Is that what you want or you want them to use different providers?
I can't understand what you mean by the following:
1. Update Cloud provider and profile with provider1 and profile1 respectively and execute salt-cloud -p profile1 VM-1
2. Simultaneous append Cloud provider and profile with provider2 and profile2 respectively and execute salt-cloud -p profile2 VM-2
@nmadhok that was typo error I have updated same. I wanted to used different profile with provider i.e profile1 with provider1 and profile2 with provider2 simultaneously
@nmadhok : How do I use -P option using Salt Cloud python api. Issue is failing when I try to deploy VM using salt cloud python api simultaneously.
Any updates on this issue? This seems to be more like an issue creating VM's in parallel using the api and not just specific to VMware cloud driver. @cachedout @techhat Thoughts?
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.