ionos-cloud / module-ansible

Apache License 2.0
9 stars 8 forks source link

cannot create server anymore #206

Closed fansari closed 1 month ago

fansari commented 1 month ago

Description

Attempt to create a server in the IONOS cloud gives an error message:

failed to complete: [VDC-5-0] An unexpected error occurred

It is not clear to me whether this really is a bug or caused by some other issue.

What I can say is that we were able to create servers in the IONOS cloud up to three months ago.

Expected behavior

The server should be created.

Environment

Ansible version:

ansible-core-2.14.9-1.el9.x86_64

Module version:

ionoscloudsdk.ionoscloud-7.4.1

OS:

CentOS 9

Configuration Files

How to Reproduce

Run an ansible playbook with a task like this:

---
- name: Provision instance
  ionoscloudsdk.ionoscloud.server:
    datacenter: "MyTest"
    name: "my-test-03"
    cpu_family: "INTEL_SKYLAKE"
    disk_type: "SSD"
    availability_zone: "ZONE_1"
    user_data: ""
    cores: 2
    ram: 4096
    image: "windows:2022"
    image_password: "xxx"
    location: "de/txl"
    assign_public_ip: false
    remove_boot_volume: false
    volume_size: 100
    token: "xxx"
    wait_timeout: 1800
  register: ionos_server
  when: "config_context is defined"

- name: print result
  debug:
    msg: "{{ ionos_server }}"

Error and Debug Output

The full traceback is:
  File "/tmp/ansible_ionoscloudsdk.ionoscloud.server_payload_cu5e9zt8/ansible_ionoscloudsdk.ionoscloud.server_payload.zip/ansible_collections/ionoscloudsdk/ionoscloud/plugins/modules/server.py", line 761, in _c>
  File "/usr/local/lib/python3.9/site-packages/ionoscloud/api_client.py", line 803, in wait_for_completion
    raise ApiFailedRequest(
fatal: [my-test-03]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_replace": null,
            "api_url": null,
            "assign_public_ip": false,
            "availability_zone": "AUTO",
            "boot_cdrom": null,
            "boot_volume": null,
            "bus": "VIRTIO",
            "certificate_fingerprint": null,
            "cores": 2,
            "count": 1,
            "cpu_family": "INTEL_SKYLAKE",
            "datacenter": "MyTest",
            "depth": null,
            "disk_type": "SSD",
            "image": "windows:2022",
            "image_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "instance_ids": [],
            "lan": null,
            "location": "de/txl",
            "name": "my-test-03",
            "nat": false,
            "nic_ips": null,
            "password": null,
            "ram": 4096,
            "remove_boot_volume": false,
            "ssh_keys": [],
            "state": "present",
            "token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "user_data": "",
            "username": null,
            "volume_availability_zone": null,
            "volume_size": 100,
            "wait": true,
            "wait_timeout": 1800
        }
    },
    "msg": "failed to create the new server: Request caf0296f-4405-485b-a6d9-349eb4d3a0f7 failed to complete: [VDC-5-0] An unexpected error occurred"
}

Additional Notes

Other tests done:

References

rmocanu-ionos commented 1 month ago

Hello,

Thank you for raising this issue. I attempted to provision a server using the configuration you provided, and it seems to be working correctly on my end. This suggests that the error might be originating from the API itself. Could you please try running the process again to see if the issue persists? If the problem continues, it’s possible that some default values being sent by Ansible might be causing the API to throw errors in certain cases. I will investigate this further. Please keep me updated on whether the issue persists after retrying.

Best regards, Radu

fansari commented 1 month ago

I have run again the ansible task and still get the same error.

"failed to create the new server: Request 6bff4594-4f21-4317-ba00-de142b2ef103 failed to complete: [VDC-5-0] An unexpected error occurred"

fansari commented 1 month ago

We analysed the problem again and found that we hit the limit for SSD provisioning (which we cannot see because it is configured by our customer). A test with HDD instead was working.

So this is not a bug.

What would nice to have is a more meaning full error message for such cases.

rmocanu-ionos commented 1 month ago

hello, we have passed this on to the API team regarding improving the error message. I will close this issue now as this is not related to the Ansible module