You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/09/25 06:15:49 UTC

[GitHub] [cloudstack] dpassante opened a new issue #3934: Zones are returned in a random order

dpassante opened a new issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934


   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and master branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   API
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on master branch.
   -->
   
   ~~~
   4.13.0.0
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, advanced networking, etc.  N/A otherwise
   -->
   N/A
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   N/A
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   `listZones` returns the zones in a "random" order when it has not been explicitly defined with the new sort key feature.
   
   This impacts the correct functioning of the Ansible Cloudstack modules which use the first zone if no zone parameter is given.
   
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   
   <!-- Paste example playbooks or commands between quotes below -->
   Keep zones unsorted:
   ~~~
   mysql> select id, name, sort_key from data_center;
   +----+----------------------------+----------+
   | id | name                       | sort_key |
   +----+----------------------------+----------+
   |  1 | Sandbox-simulator-basic    |        0 |
   |  2 | Sandbox-simulator-advanced |        0 |
   +----+----------------------------+----------+
   2 rows in set (0.00 sec)
   ~~~
   
   And use a playbook in which the `zone` param is not given.
   Several calls to `listZones` also do the trick.
   
   <!-- You can also paste gist.github.com links for larger files -->
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   A list of zones sorted by SQL ID when no sort key are configured to avoid breaking some existing Ansible deployments.
   
   Ensure that a sort key is automatically incremented for new zones and existing zones in the case of a Cloudstack upgrade could also be a nice feature.
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   
   <!-- Paste verbatim command output between quotes below -->
   ~~~
   $ for in in `seq 1 1 10`; do cs listZones |grep -m1 name; done
         "name": "Sandbox-simulator-basic",
         "name": "Sandbox-simulator-basic",
         "name": "Sandbox-simulator-basic",
         "name": "Sandbox-simulator-basic",
         "name": "Sandbox-simulator-basic",
         "name": "Sandbox-simulator-basic",
         "name": "Sandbox-simulator-advanced",
         "name": "Sandbox-simulator-advanced",
         "name": "Sandbox-simulator-advanced",
         "name": "Sandbox-simulator-advanced",
   ~~~
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-722939773


   I like @weizhouapache 's id to set sort_key to id for all sortable resources, as a quick solution. I do wonder whether they should be sorted in the system at all. The sql would be half of the work, the runtime insertions will need to be implemented like that as well.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-722950522


   @weizhouapache if this is fixed in any near future release, I would be happy. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-698743047


   I see this with in 4.13.1 
   
   # vmsnapshot test revert snapshot failed
   
   note the zone that chates from basic to advance from first test to second test.
   ```
   TASK [cs_vmsnapshot : test revert snapshot] ************************************
   changed: [testhost] => {"account": "admin", "api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": true, "created": "2020-09-24T22:12:33+0000", "current": true, "display_name": "ansible-test-fv-az176-89231118_snapshot", "domain": "ROOT", "id": "230bab25-dcd6-4641-97c5-79396730eef6", "name": "i-2-12-QA_VS_20200924221233", "state": "Ready", "tags": [], "type": "DiskAndMemory", "zone": "Sandbox-simulator-basic"}
   
   TASK [cs_vmsnapshot : verify test revert snapshot] *****************************
   ok: [testhost] => {
       "changed": false,
       "msg": "All assertions passed"
   }
   
   TASK [cs_vmsnapshot : test remove snapshot in check mode] **********************
   fatal: [testhost]: FAILED! => {"api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": false, "msg": "Virtual machine 'ansible-test-fv-az176-89231118-vm-snapshot' not found", "zone": "Sandbox-simulator-advanced"}
   ```
   
   but seems not to happen always, another test run passes.
   ```
    TASK [cs_vmsnapshot : test remove snapshot in check mode] **********************
   changed: [testhost] => {"account": "admin", "api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": true, "created": "2020-09-24T22:10:49+0000", "current": true, "display_name": "ansible-test-fv-az76-30345916_snapshot", "domain": "ROOT", "id": "4013a799-6d7c-442c-8906-1a6162e3086e", "name": "i-2-14-QA_VS_20200924221049", "state": "Ready", "tags": [], "type": "DiskAndMemory", "zone": "Sandbox-simulator-basic"}
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-698743047


   I see this with in 4.13.1 
   
   # vmsnapshot test revert snapshot failed
   
   note the zone that chates from basic to advance from first test to second test.
   ```
   TASK [cs_vmsnapshot : test revert snapshot] ************************************
   changed: [testhost] => {"account": "admin", "api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": true, "created": "2020-09-24T22:12:33+0000", "current": true, "display_name": "ansible-test-fv-az176-89231118_snapshot", "domain": "ROOT", "id": "230bab25-dcd6-4641-97c5-79396730eef6", "name": "i-2-12-QA_VS_20200924221233", "state": "Ready", "tags": [], "type": "DiskAndMemory", "zone": "Sandbox-simulator-basic"}
   
   TASK [cs_vmsnapshot : verify test revert snapshot] *****************************
   ok: [testhost] => {
       "changed": false,
       "msg": "All assertions passed"
   }
   
   TASK [cs_vmsnapshot : test remove snapshot in check mode] **********************
   fatal: [testhost]: FAILED! => {"api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": false, "msg": "Virtual machine 'ansible-test-fv-az176-89231118-vm-snapshot' not found", "zone": "Sandbox-simulator-advanced"}
   ```
   
   but seems not to happen always, another test run passes.
   ```
    TASK [cs_vmsnapshot : test remove snapshot in check mode] **********************
   changed: [testhost] => {"account": "admin", "api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": true, "created": "2020-09-24T22:10:49+0000", "current": true, "display_name": "ansible-test-fv-az76-30345916_snapshot", "domain": "ROOT", "id": "4013a799-6d7c-442c-8906-1a6162e3086e", "name": "i-2-14-QA_VS_20200924221049", "state": "Ready", "tags": [], "type": "DiskAndMemory", "zone": "Sandbox-simulator-basic"}
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] weizhouapache commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-721731075


   @resmo this workaround should work for you.
   
   ```
   UPDATE `cloud`.`data_center` SET `sort_key` = `id` WHERE `sort_key` = 0;
   ```
   this change will break the ordering of zones if users set sort_key to a non-zero value and use sort_key to order zones. so I will not sure if we can merge this change into 4.14.1.0 or 4.15.0.0
   
   this issue might exists with template, disk offering, service offering, network offering as well.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo edited a comment on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo edited a comment on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-698743047


   I see this with in 4.13.1 
   
   # vmsnapshot test revert snapshot failed
   
   note the zone that changes from basic to advance from first test to second test.
   
   https://github.com/ngine-io/ansible-collection-cloudstack/pull/40/checks?check_run_id=1162936780#step:6:3610
   
   ```
   TASK [cs_vmsnapshot : test revert snapshot] ************************************
   changed: [testhost] => {"account": "admin", "api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": true, "created": "2020-09-24T22:12:33+0000", "current": true, "display_name": "ansible-test-fv-az176-89231118_snapshot", "domain": "ROOT", "id": "230bab25-dcd6-4641-97c5-79396730eef6", "name": "i-2-12-QA_VS_20200924221233", "state": "Ready", "tags": [], "type": "DiskAndMemory", "zone": "Sandbox-simulator-basic"}
   
   TASK [cs_vmsnapshot : verify test revert snapshot] *****************************
   ok: [testhost] => {
       "changed": false,
       "msg": "All assertions passed"
   }
   
   TASK [cs_vmsnapshot : test remove snapshot in check mode] **********************
   fatal: [testhost]: FAILED! => {"api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": false, "msg": "Virtual machine 'ansible-test-fv-az176-89231118-vm-snapshot' not found", "zone": "Sandbox-simulator-advanced"}
   ```
   
   but seems not to happen always, another test run passes.
   ```
    TASK [cs_vmsnapshot : test remove snapshot in check mode] **********************
   changed: [testhost] => {"account": "admin", "api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": true, "created": "2020-09-24T22:10:49+0000", "current": true, "display_name": "ansible-test-fv-az76-30345916_snapshot", "domain": "ROOT", "id": "4013a799-6d7c-442c-8906-1a6162e3086e", "name": "i-2-14-QA_VS_20200924221049", "state": "Ready", "tags": [], "type": "DiskAndMemory", "zone": "Sandbox-simulator-basic"}
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-721721227


   @DaanHoogland well, we have to make the previous optional zone argument a required argument in almost all modules. This will break backwards compatibly, which means we make most likely many users angry.
   
   You can call this ""work around" I call it a bad user experience for a "fix" introduced by cloudstack and which should be fixed by cloudstack and not by its clients or users.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo edited a comment on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo edited a comment on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-721721227


   @DaanHoogland well, we have to make the previous optional zone argument a required argument in almost all modules. This will break backwards compatibly, which means we make most likely many users angry.
   
   You can call this ""work around" I call it a bad user experience for a bug introduced by cloudstack and which should be fixed by cloudstack and not by its clients or users.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-669064811


   @dpassante I tested 4.14/master I'm not able to see this. In UI as root admin you can re-order the zones and the order is honoured.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] weizhouapache commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-722214746


   > @weizhouapache no, this won't work for me.
   > 
   > I am not referring to one single specific installation. I am speaking of the API clients and ansible integration relying on the API to behave predicable and stable, now and in the future. It is not the first time I fixed regressions of the API in API clients and ansible modules.
   > 
   > > this issue might exists with template, disk offering, service offering, network offering as well.
   > 
   > As a cloudstack apache member, I won't accept we break the API on purpose and let users work around it. The fact, this issue exists not only for zones but for other resources makes it even worse!
   
   @resmo I mean the sql change should fix the issue that "zones are returned in random order' of existing environment.
   If you do not have your own fork and use the official release, there is no way to make sql change during process managed by ansible, then you have to wait for next official release, which could have a fix for this issue (either this db change or other api/java change).
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rvalle commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
rvalle commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-699922153


   @resmo @rhtyd 
   
   The result that @resmo expect, or ansible modules expect, would require zones to be sorted by the expression (sortkey,id), as you know when sortkey has the same value, id is used... etc.
   
   So I have been looking at the code to check what the actual implemented order criteria is:
   
   looks to me like the method is here: https://github.com/apache/cloudstack/blob/82b6971258a2f63360dbd0cb404fcf87669a5327/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java#L3053
   
   But this method seems to rely on an utility: 
   
   https://github.com/apache/cloudstack/blob/82b6971258a2f63360dbd0cb404fcf87669a5327/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java#L3075
   
   Which seems to take a single field as order to build the underlying SQL.
   
   This utility would need to be restructured so to allow more than one field to be specified as order key.
   
   On the other hand @resmo, are you sure this has ever worked? I mean that cloudstack has returned zones in a deterministic order in the past? It is common for databases not to assure any row order when no order clause is specified but still to return the rows in the order they were created...
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo edited a comment on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo edited a comment on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-698743047


   I see this with in 4.13.1 
   note the zone that changes from basic to advance from first test to second test.
   
   https://github.com/ngine-io/ansible-collection-cloudstack/pull/40/checks?check_run_id=1162936780#step:6:3610
   
   ```
   TASK [cs_vmsnapshot : test revert snapshot] ************************************
   changed: [testhost] => {"account": "admin", "api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": true, "created": "2020-09-24T22:12:33+0000", "current": true, "display_name": "ansible-test-fv-az176-89231118_snapshot", "domain": "ROOT", "id": "230bab25-dcd6-4641-97c5-79396730eef6", "name": "i-2-12-QA_VS_20200924221233", "state": "Ready", "tags": [], "type": "DiskAndMemory", "zone": "Sandbox-simulator-basic"}
   
   TASK [cs_vmsnapshot : verify test revert snapshot] *****************************
   ok: [testhost] => {
       "changed": false,
       "msg": "All assertions passed"
   }
   
   TASK [cs_vmsnapshot : test remove snapshot in check mode] **********************
   fatal: [testhost]: FAILED! => {"api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": false, "msg": "Virtual machine 'ansible-test-fv-az176-89231118-vm-snapshot' not found", "zone": "Sandbox-simulator-advanced"}
   ```
   
   this is the code for the zone selection: https://github.com/ngine-io/ansible-collection-cloudstack/blob/master/plugins/module_utils/cloudstack.py#L467
   
   If this is a wanted behavior, what is the correct way to select the default zone?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-721634888


   @resmo @dpassante do you have a fix or work around? it seems to me not a serious issue but please correct me on that.
   @rhtyd @shwstppr @davidjumani is sort order still used the same way in primate? should the default be -1 instead of 0 for instance?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-722948281


   also see #2735 for another example of breaking the API


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd closed issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
rhtyd closed issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo edited a comment on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo edited a comment on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-698743047






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd closed issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
rhtyd closed issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] weizhouapache commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-699933145


   @rvalle agrees. It should be a regression issue caused by #3242
   sort_key are all 0 in cloud.data_center table.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-722947387


   > If you do not have your own fork and use the official release, there is no way to make sql change during process managed by ansible, then you have to wait for next official release, which could have a fix for this issue (either this db change or other api/java change).
   
   probably misunderstanding, ansible modules as clients interacting wiht API of cloudstack https://galaxy.ansible.com/ngine_io/cloudstack rely on a stable API. Once a cloudstack user upgrades to a newer cloudstack version, all clients, be it an ansible module or a library or a cloudmonkey cli should still work as before unless we, as a cloudstack devs, make the decision to break the API. That is what I wanted to point out. 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-672757848


   Tested latest master, could not see the issue.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo commented on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo commented on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-721748001


   @weizhouapache no, this won't work for me. 
   
   I am not referring to one single specific installation. I am speaking of the API clients and ansible integration relying on the API to behave predicable and stable, now and in the future. It is not the first time I fixed regressions of the API in API clients and ansible modules.
   
   > this issue might exists with template, disk offering, service offering, network offering as well.
   
   As a cloudstack apache member, I won't accept we break the API on purpose and let users work around it. The fact, this issue exists not only for zones but for other resources makes it even worse! 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo edited a comment on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo edited a comment on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-698743047


   I see this with in 4.13.1 
   
   # vmsnapshot test revert snapshot failed
   
   note the zone that changes from basic to advance from first test to second test.
   
   https://github.com/ngine-io/ansible-collection-cloudstack/pull/40/checks?check_run_id=1162936780#step:6:3610
   
   ```
   TASK [cs_vmsnapshot : test revert snapshot] ************************************
   changed: [testhost] => {"account": "admin", "api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": true, "created": "2020-09-24T22:12:33+0000", "current": true, "display_name": "ansible-test-fv-az176-89231118_snapshot", "domain": "ROOT", "id": "230bab25-dcd6-4641-97c5-79396730eef6", "name": "i-2-12-QA_VS_20200924221233", "state": "Ready", "tags": [], "type": "DiskAndMemory", "zone": "Sandbox-simulator-basic"}
   
   TASK [cs_vmsnapshot : verify test revert snapshot] *****************************
   ok: [testhost] => {
       "changed": false,
       "msg": "All assertions passed"
   }
   
   TASK [cs_vmsnapshot : test remove snapshot in check mode] **********************
   fatal: [testhost]: FAILED! => {"api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": false, "msg": "Virtual machine 'ansible-test-fv-az176-89231118-vm-snapshot' not found", "zone": "Sandbox-simulator-advanced"}
   ```
   
   but seems not to happen always, another test run passes.
   ```
    TASK [cs_vmsnapshot : test remove snapshot in check mode] **********************
   changed: [testhost] => {"account": "admin", "api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": true, "created": "2020-09-24T22:10:49+0000", "current": true, "display_name": "ansible-test-fv-az76-30345916_snapshot", "domain": "ROOT", "id": "4013a799-6d7c-442c-8906-1a6162e3086e", "name": "i-2-14-QA_VS_20200924221049", "state": "Ready", "tags": [], "type": "DiskAndMemory", "zone": "Sandbox-simulator-basic"}
   ```
   
   this is the code for the zone selection: https://github.com/ngine-io/ansible-collection-cloudstack/blob/master/plugins/module_utils/cloudstack.py#L467
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] resmo edited a comment on issue #3934: Zones are returned in a random order

Posted by GitBox <gi...@apache.org>.
resmo edited a comment on issue #3934:
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-698743047


   I see this with in 4.13.1 
   
   # vmsnapshot test revert snapshot failed
   
   note the zone that changes from basic to advance from first test to second test.
   
   https://github.com/ngine-io/ansible-collection-cloudstack/pull/40/checks?check_run_id=1162936780#step:6:3610
   
   ```
   TASK [cs_vmsnapshot : test revert snapshot] ************************************
   changed: [testhost] => {"account": "admin", "api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": true, "created": "2020-09-24T22:12:33+0000", "current": true, "display_name": "ansible-test-fv-az176-89231118_snapshot", "domain": "ROOT", "id": "230bab25-dcd6-4641-97c5-79396730eef6", "name": "i-2-12-QA_VS_20200924221233", "state": "Ready", "tags": [], "type": "DiskAndMemory", "zone": "Sandbox-simulator-basic"}
   
   TASK [cs_vmsnapshot : verify test revert snapshot] *****************************
   ok: [testhost] => {
       "changed": false,
       "msg": "All assertions passed"
   }
   
   TASK [cs_vmsnapshot : test remove snapshot in check mode] **********************
   fatal: [testhost]: FAILED! => {"api_http_method": "get", "api_key": "DL3Be8XtxsrKJOMRIIPR_2LUdknE5n8V33u41NWaetVcnKAQTeQhkDDVKAJCIyHV1I4fY3Phw8B49BpSnfLKtg", "api_region": "cloudstack", "api_timeout": 60, "api_url": "http://cloudstack-sim:8888/client/api", "api_verify_ssl_cert": null, "changed": false, "msg": "Virtual machine 'ansible-test-fv-az176-89231118-vm-snapshot' not found", "zone": "Sandbox-simulator-advanced"}
   ```
   
   this is the code for the zone selection: https://github.com/ngine-io/ansible-collection-cloudstack/blob/master/plugins/module_utils/cloudstack.py#L467
   
   If this is a wanted behavior, what is the correct way to select the default zone?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org