ansible / ansible-modules-core

Ansible modules - these modules ship with ansible
1.3k stars 1.95k forks source link

azure_rm_virtualmachine fails to find resource group upon vm creation #5807

Closed barrymac closed 7 years ago

barrymac commented 7 years ago
ISSUE TYPE
ANSIBLE VERSION

ansible 2.2.0.0 also tried with github pip install at this time

CONFIGURATION
OS / ENVIRONMENT

Linux

pip freeze | grep azure
azure==2.0.0rc5
azure-batch==0.30.0rc5
azure-cli==0.1.0b10
azure-cli-acr==0.1.0b10
azure-cli-acs==0.1.0b10
azure-cli-appservice==0.1.0b10
azure-cli-cloud==0.1.0b10
azure-cli-component==0.1.0b10
azure-cli-configure==0.1.0b10
azure-cli-container==0.1.0b10
azure-cli-context==0.1.0b10
azure-cli-core==0.1.0b10
azure-cli-feedback==0.1.0b10
azure-cli-network==0.1.0b10
azure-cli-profile==0.1.0b10
azure-cli-resource==0.1.0b10
azure-cli-role==0.1.0b10
azure-cli-storage==0.1.0b10
azure-cli-vm==0.1.0b10
azure-common==1.1.4
azure-graphrbac==0.30.0rc6
azure-mgmt==0.30.0rc5
azure-mgmt-authorization==0.30.0rc6
azure-mgmt-batch==0.30.0rc5
azure-mgmt-cdn==0.30.0rc5
azure-mgmt-cognitiveservices==0.30.0rc5
azure-mgmt-commerce==0.30.0rc5
azure-mgmt-compute==0.32.1
azure-mgmt-containerregistry==0.1.0
azure-mgmt-dns==0.30.0rc6
azure-mgmt-keyvault==0.30.0rc5
azure-mgmt-logic==0.30.0rc5
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==0.30.0rc5
azure-mgmt-resource==0.30.2
azure-mgmt-scheduler==0.30.0rc5
azure-mgmt-storage==0.30.0rc6
azure-mgmt-trafficmanager==0.30.0rc6
azure-mgmt-web==0.30.1
azure-nspkg==1.0.0
azure-servicebus==0.20.2
azure-servicemanagement-legacy==0.20.3
azure-storage==0.33.0
msrestazure==0.4.5
SUMMARY

Vm creation is not successful due to error about not finding an existing Resource Group that is listed by azure cli fatal: [development-tools]: FAILED! => {"changed": false, "failed": true, "msg": "Parameter error: resource group Development not found"}

STEPS TO REPRODUCE

- name: Create a VM
  azure_rm_virtualmachine:
    resource_group: Development
    name: testvm
    image:
      offer: UbuntuServer
      publisher: Canonical
      sku: '14.04.4-LTS'
EXPECTED RESULTS

Expected vm to be created

ACTUAL RESULTS
fatal: [development-tools]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "invocation": {
        "module_args": {
            "ad_user": null, 
            "admin_password": null, 
            "admin_username": "admin", 
            "allocated": true, 
            "append_tags": true, 
            "client_id": null, 
            "image": {
                "offer": "UbuntuServer", 
                "publisher": "Canonical", 
                "sku": "14.04.4-LTS"
            }, 
            "location": null, 
            "name": "testvm", 
            "network_interface_names": null, 
            "open_ports": null, 
            "os_disk_caching": "ReadOnly", 
            "os_type": "Linux", 
            "password": null, 
            "profile": null, 
            "public_ip_allocation_method": "Static", 
            "remove_on_absent": [
                "all"
            ], 
            "resource_group": "Development", 
            "restarted": false, 
            "secret": null, 
            "short_hostname": null, 
            "ssh_password_enabled": true, 
            "ssh_public_keys": null, 
            "started": true, 
            "state": "present", 
            "storage_account_name": null, 
            "storage_blob_name": null, 
            "storage_container_name": "vhds", 
            "subnet_name": null, 
            "subscription_id": null, 
            "tags": null, 
            "tenant": null, 
            "virtual_network_name": null, 
            "vm_size": "Standard_D1"
        }, 
        "module_name": "azure_rm_virtualmachine"
    }, 
    "msg": "Parameter error: resource group Development not found"
}
ansibot commented 7 years ago

@ansible ping, this issue is waiting for your response. click here for bot help

ansibot commented 7 years ago

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

s19n commented 7 years ago

@barrymac, did you find a solution? I have the same problem.

paprickar commented 7 years ago

Same issues here .... Update: Permissions for my Service principal in this specific subscription was missing!

ansibot commented 7 years ago

This issue was migrated to https://github.com/ansible/ansible/issues/29447