saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.18k stars 5.48k forks source link

profile fields in azurearm salt-cloud need to be actualized to sources #40084

Closed podstava closed 6 years ago

podstava commented 7 years ago

Description of Issue/Question

profile fields in azurearm salt-cloud need to be actualized to sources in docs: virtual_network_name in sources: network

maybe some more fields. Need to research

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.) used salt-cloud develop branch

Ch3LL commented 7 years ago

@podstava i'm not seeing virtual_network_name in the azurearm docs only in azure docs. Can you point me to where you are seeing this.

podstava commented 7 years ago

You're right, my fault. but i think it must be documented anyway. It doesn't work without profile configs like these:

azure-ubuntu:
  provider: azure-arm
  image: Canonical|UbuntuServer|14.04.5-LTS|latest
  size: Standard_A2_v2
  location: 'West US'
  ssh_username: azureuser
  ssh_password: verybadpass
  network_resource_group: testazure-rg
  resource_group: testazure-rg
  network: testazure-vnet
  subnet: testazure-subnet

Also i've got a new error while creating vm via azurearm: I'm running salt-cloud -l debug -p azure-ubuntu azure-ubuntu.

[ERROR   ] There was a profile error: 'NetworkInterface' object has no attribute 'get'
Traceback (most recent call last):
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/utils/msazure.py", line 194, in object_to_dict
    if inspect.isclass(obj) or 'class' in str(type(obj.__dict__.get(item))):
AttributeError: 'bool' object has no attribute '__dict__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/utils/msazure.py", line 195, in object_to_dict
    ret[item] = object_to_dict(obj.__dict__[item])
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/utils/msazure.py", line 201, in object_to_dict
    ret[item] = obj.get(item)
AttributeError: 'bool' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/cloud/cli.py", line 284, in run
    self.config.get('names')
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/cloud/__init__.py", line 1444, in run_profile
    ret[name] = self.create(vm_)
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/cloud/__init__.py", line 1274, in create
    output = self.clouds[func](vm_)
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/cloud/clouds/azurearm.py", line 1185, in create
    'wait_for_ip_interval_multiplier', vm_, __opts__, default=1),
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/utils/cloud.py", line 2413, in wait_for_ip
    data = update_callback(*update_args, **update_kwargs)
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/cloud/clouds/azurearm.py", line 1160, in _query_ip_address
    data = request_instance(kwargs=vm_)
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/cloud/clouds/azurearm.py", line 959, in request_instance
    iface_data = create_interface(kwargs=vm_)
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/cloud/clouds/azurearm.py", line 908, in create_interface
    return show_interface(kwargs=kwargs)
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/cloud/clouds/azurearm.py", line 705, in show_interface
    data = object_to_dict(iface)
  File "/home/podstava/PycharmProjects/customer-be/.env/lib/python3.5/site-packages/salt/utils/msazure.py", line 201, in object_to_dict
    ret[item] = obj.get(item)
AttributeError: 'NetworkInterface' object has no attribute 'get'

I`m using salt===2016.11.0-995-g39a6392 azure==2.0.0rc6 azure-batch==1.0.0 azure-common==1.1.4 azure-graphrbac==0.30.0rc5 azure-mgmt==0.30.0rc6 azure-mgmt-authorization==0.30.0rc5 azure-mgmt-batch==1.0.0 azure-mgmt-cdn==0.30.0rc5 azure-mgmt-cognitiveservices==0.30.0rc5 azure-mgmt-commerce==0.30.0rc5 azure-mgmt-compute==0.30.0rc6 azure-mgmt-keyvault==0.30.0rc6 azure-mgmt-logic==1.0.0 azure-mgmt-network==0.30.0rc6 azure-mgmt-notificationhubs==0.30.0rc5 azure-mgmt-nspkg==1.0.0 azure-mgmt-powerbiembedded==0.30.0rc5 azure-mgmt-redis==1.0.0 azure-mgmt-resource==0.30.0rc6 azure-mgmt-scheduler==1.0.0 azure-mgmt-storage==0.30.0rc6 azure-mgmt-web==0.30.0rc5 azure-nspkg==1.0.0 azure-servicebus==0.20.3 azure-servicemanagement-legacy==0.20.4 azure-storage==0.33.0

Seems like it an error in object_to_dict method in msazure.py. Or maybe I'm doing something wrong? I'll be glad if you'll help me with it. Thanks

Ch3LL commented 7 years ago

Agreed this needs to be documnted for network. I am not seeing this in the azure arm docs here

Concerning your other issue ping @techhat do you see where @podstava might need ot change a configuration to get azure arm setup correctly? Or any other ideas?

techhat commented 7 years ago

It should be documented. But I'm not necessarily in agreement with making all of our variables match the upstream SDK/API; some of those names are way too long to be reasonable. I'll go through today and update the ARM docs.

techhat commented 7 years ago

40564 should correct discrepancies in the documentation.

stale[bot] commented 6 years ago

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.