-
Notifications
You must be signed in to change notification settings - Fork 332
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
azure.azcollection 1.14.0 azure_rm_manageddisk failed to create disk : Error getting virtual machine debian12 - No value for given attribute #1394
Comments
@fabriceverkor You are welcome to submit any problems you encounter, but from your error log and test logs, you know that an error occurred while attaching the disk to the VM, and an exception was displayed while getting the VM's status. Can you check that your VM exists and that the VM status is' success'? Thank you! |
Yes, the VM is created before to create disk, see complete playbook below. The same playbook works fine on a ansible server with azure.azcollection 1.13.0 and Ansible core 2.12.10
The VM is properly created without error,as show output below, I could connect by SSH on it. _PLAY [Create VM in Azure] *************************************************************************************************** TASK [Create Azure Credential file] ***************************************************************************************** TASK [Create /root/.azure directory] **************************************************************************************** TASK [Create Azure Credential file] ***************************************************************************************** TASK [Create resource group] ************************************************************************************************ TASK [Create server interface] ********************************************************************************************** TASK [Create VM with Public Image] ****************************************************************************************** TASK [Create managed disks] ************************************************************************************************* |
@fabriceverkor I used the script you provided and did not encounter your error, creating the VM successfully and mounting the disk to the virtual machine. What version of Aze. azcollections are you using? The current version has been upgraded to v2.1.0, can you update to the latest version? Thank you!
|
As you can see below, I have the last versions. ansible-galaxy collection list azure.azcollection /etc/ansible/collections/ansible_collectionsCollection Version azure.azcollection 2.1.1 /usr/lib/python3/dist-packages/ansible_collectionsCollection Version azure.azcollection 1.14.0 |
@fabriceverkor However, it is strange that I did not encounter the problem you mentioned after repeated tests, no matter 1.13.0, 1.14.0 or 2.1.0. Do you have the conditions to rebuild an environment and install the v2.1.0 version to try? I'd like to rule out any environmental contamination of the test. Thank you very much! |
@Fred-sun I am using the latest version
I am able to reproduce the same issue.
The VM is created and running. The same code was working till 30th Nov, but it was not used for a while and noticed this issue today. So unsure of the prior version when it stopped working. |
@vijayreddiar Sorry for reply later! This is very strange. I have tried multiple tests, but you can't see the problem you're experiencing. I'm so sorry! |
@Fred-sun It doesn't look like an environmental issue because I was able to mount the disk manually from Azure Portal. The playbook creates the disk, but fails only when attempting to mount. PFB the playbook tasks.
PFB the output of these specific tasks.
I am going to test the same scenario using old version of |
@Fred-sun I am able to attach the disk using azure.azcollection Can this be related to #1201? PFB the output of successful attachment of disk using azure.azcollection
|
@vijayreddiar Thanks for your feedback! I have know the cause of the issue, is try to resolve! |
@vijayreddiar Fixed by #1407 |
SUMMARY
On new Debian Bookworm, azure.azcollection 1.14.0 azure_rm_manageddisk failed to create disk : Error getting virtual machine debian12 - No value for given attribute
On old Debian Bullseye, The same code with azure.azcollection 1.13.0 azure_rm_manageddisk works fine.
ISSUE TYPE
COMPONENT NAME
azure.azcollection.azure_rm_manageddisk
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Debian Bookworm
azure-cli 2.55.0-1~bullseye
STEPS TO REPRODUCE
ansble-playbook create_disk.yml
EXPECTED RESULTS
A new disk debian12-data1 should be created and attached to VM debian12.
It works from a Debian Bullseye with azure.azcollection 1.13.0 and azure-cli 2.55.0-1~bookworm
ACTUAL RESULTS
Disk is created but not attached to VM debian12, with error below :
Error getting virtual machine debian12 - No value for given attribute
``
TASK [Create managed disks] **************************************************************************************************************
task path: /etc/ansible/playbooks/Azure/create_vm.yml:84
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "
echo /root/.ansible/tmp
"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1704454723.8986018-86892-161874392700225 `" && echo ansible-tmp-1704454723.8986018-86892-161874392700225="` echo /root/.ansible/tmp/ansible-tmp-1704454723.8986018-86892-161874392700225 `" ) && sleep 0'Using module file /etc/ansible/collections/ansible_collections/azure/azcollection/plugins/modules/azure_rm_manageddisk.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-86795u2pa7sep/tmp9ln0ubw0 TO /root/.ansible/tmp/ansible-tmp-1704454723.8986018-86892-161874392700225/AnsiballZ_azure_rm_manageddisk.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1704454723.8986018-86892-161874392700225/ /root/.ansible/tmp/ansible-tmp-1704454723.8986018-86892-161874392700225/AnsiballZ_azure_rm_manageddisk.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1704454723.8986018-86892-161874392700225/AnsiballZ_azure_rm_manageddisk.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1704454723.8986018-86892-161874392700225/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
File "/tmp/ansible_azure.azcollection.azure_rm_manageddisk_payload_vcr1msn1/ansible_azure.azcollection.azure_rm_manageddisk_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_manageddisk.py", line 563, in _get_vm
File "/usr/local/lib/python3.11/dist-packages/azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/azure/mgmt/compute/v2021_04_01/operations/_virtual_machines_operations.py", line 1492, in get
request = build_get_request(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/azure/mgmt/compute/v2021_04_01/operations/_virtual_machines_operations.py", line 243, in build_get_request
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/msrest/serialization.py", line 652, in url
output = self.serialize_data(data, data_type, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/msrest/serialization.py", line 760, in serialize_data
raise ValueError("No value for given attribute")
failed: [localhost] (item={'key': 'data1', 'value': {'disk': '/dev/sdc', 'lun': 1, 'type': 'Standard_LRS', 'size': 20}}) => {
"ansible_loop_var": "item",
"changed": false,
"invocation": {
"module_args": {
"ad_user": null,
"adfs_authority_url": null,
"api_profile": "latest",
"append_tags": true,
"attach_caching": null,
"auth_source": "auto",
"cert_validation_mode": null,
"client_id": null,
"cloud_environment": "AzureCloud",
"create_option": null,
"disk_size_gb": 20,
"location": null,
"log_mode": null,
"log_path": null,
"lun": 1,
"managed_by": "debian12",
"managed_by_extended": null,
"max_shares": null,
"name": "debian12-data1",
"os_type": null,
"password": null,
"profile": "default",
"resource_group": "debian12-rg",
"secret": null,
"source_uri": null,
"state": "present",
"storage_account_id": null,
"storage_account_type": "Standard_LRS",
"subscription_id": null,
"tags": null,
"tenant": null,
"thumbprint": null,
"x509_certificate_path": null,
"zone": null
}
},
"item": {
"key": "data1",
"value": {
"disk": "/dev/sdc",
"lun": 1,
"size": 20,
"type": "Standard_LRS"
}
},
"msg": "Error getting virtual machine debian12 - No value for given attribute"
}
The text was updated successfully, but these errors were encountered: