Skip to content
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

Attach an attached/detached volume from OpenStack VM’s should return similar information #21558

Merged
merged 1 commit into from
Oct 20, 2019

Conversation

phongle1205
Copy link
Contributor

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

os_server_volume

ANSIBLE VERSION
ansible 2.1.1.0
  config file = /vagrant/provision/ansible.cfg
  configured module search path = Default w/o overrides
SUMMARY

Currently, attach an attached volume from OpenStack VM’s returns only
argument data. It is better to return full data as attaching a detached
volume.

In my use case, I need the extra data to mount and format the volume.

Before change:

ok: [localhost] => {
    "attach_result": {
        "changed": false, 
        "msg": "All items completed", 
        "results": [
            {
                "_ansible_item_result": true, 
                "_ansible_no_log": false, 
                "changed": false, 
                "invocation": {
                    "module_args": {
                        "api_timeout": null, 
                        "auth": null, 
                        "auth_type": null, 
                        "availability_zone": null, 
                        "cacert": null, 
                        "cert": null, 
                        "cloud": null, 
                        "device": null, 
                        "endpoint_type": "public", 
                        "key": null, 
                        "region_name": null, 
                        "server": "xxx-yyy-zzz", 
                        "state": "present", 
                        "timeout": 180, 
                        "verify": true, 
                        "volume": "xxx-yyy-zzz-backup", 
                        "wait": true
                    }, 
                    "module_name": "os_server_volume"
                }, 
                "volume": {
                    "name": "backup", 
                    "size": 1
                }
            }
        ]
    }
}

After change:

ok: [localhost] => {
    "attach_result": {
        "changed": false, 
        "msg": "All items completed", 
        "results": [
            {
                "_ansible_item_result": true, 
                "_ansible_no_log": false, 
                "attachments": [
                    {
                        "attached_at": "2016-11-02T14:32:33.000000", 
                        "attachment_id": "771386ba-a28a-446b-b2d5-7748fec07dad", 
                        "device": "/dev/vdb", 
                        "host_name": null, 
                        "id": "1b20cbcc-08ba-4247-a000-2fbcc66ad3c5", 
                        "server_id": "22d67beb-8ad0-40a4-a85a-643c0ae847ca", 
                        "volume_id": "1b20cbcc-08ba-4247-a000-2fbcc66ad3c5"
                    }
                ], 
                "changed": false, 
                "id": "1b20cbcc-08ba-4247-a000-2fbcc66ad3c5", 
                "invocation": {
                    "module_args": {
                        "api_timeout": null, 
                        "auth": null, 
                        "auth_type": null, 
                        "availability_zone": null, 
                        "cacert": null, 
                        "cert": null, 
                        "cloud": null, 
                        "device": null, 
                        "endpoint_type": "public", 
                        "key": null, 
                        "region_name": null, 
                        "server": "xxx-yyy-zzz", 
                        "state": "present", 
                        "timeout": 180, 
                        "verify": true, 
                        "volume": "xxx-yyy-zzz-backup", 
                        "wait": true
                    }, 
                    "module_name": "os_server_volume"
                }, 
                "openstack": {
                    "HUMAN_ID": true, 
                    "NAME_ATTR": "name", 
                    "OS-DCF:diskConfig": "MANUAL", 
                    "OS-EXT-AZ:availability_zone": "cbk1", 
                    "OS-EXT-STS:power_state": 1, 
                    "OS-EXT-STS:task_state": null, 
                    "OS-EXT-STS:vm_state": "active", 
                    "OS-SRV-USG:launched_at": "2016-11-02T14:28:53.000000", 
                    "OS-SRV-USG:terminated_at": null, 
                    "accessIPv4": "", 
                    "accessIPv6": "", 
                    "addresses": {
                        "xxx-yyy-internal": [
                            {
                                "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:76:eb:db", 
                                "OS-EXT-IPS:type": "fixed", 
                                "addr": "192.168.0.95", 
                                "version": 4
                            }
                        ]
                    }, 
                    "az": "cbk1", 
                    "cloud": "int", 
                    "config_drive": "", 
                    "created": "2016-11-02T14:28:47Z", 
                    "flavor": {
                        "id": "368b9719-821c-4d4f-945d-4c2c569ae5d9", 
                        "name": "m1.micro"
                    }, 
                    "hostId": "434791113137d3015ab2c8692c230f8119bb158efac4244954f30254", 
                    "human_id": "xxx-yyy-zzz", 
                    "id": "22d67beb-8ad0-40a4-a85a-643c0ae847ca", 
                    "image": {
                        "id": "f28d7635-c122-4f4b-ae9a-9986b8a8c109", 
                        "name": "Ubuntu 14.04 sys11-cloudimg amd64"
                    }, 
                    "interface_ip": "", 
                    "key_name": "my_key_name", 
                    "metadata": {
                        "inventory_groups": "public, ungrouped", 
                        "inventory_hostname": "zzz"
                    }, 
                    "name": "xxx-yyy-zzz", 
                    "networks": {
                        "xxx-yyy-internal": [
                            "192.168.0.95"
                        ]
                    }, 
                    "os-extended-volumes:volumes_attached": [
                        {
                            "id": "1b20cbcc-08ba-4247-a000-2fbcc66ad3c5"
                        }
                    ], 
                    "private_v4": "192.168.0.95", 
                    "progress": 0, 
                    "public_v4": "", 
                    "public_v6": "", 
                    "region": "cbk", 
                    "request_ids": [], 
                    "security_groups": [
                        {
                            "description": "Default security group", 
                            "id": "3168822c-c8cd-4a46-9d28-82ec7a44f0d2", 
                            "name": "default", 
                            "security_group_rules": [
                                {
                                    "direction": "ingress", 
                                    "ethertype": "IPv4", 
                                    "id": "e69237ab-d9e7-40e4-8459-2ec0d2c7f95c", 
                                    "port_range_max": null, 
                                    "port_range_min": null, 
                                    "protocol": null, 
                                    "remote_ip_prefix": null, 
                                    "security_group_id": "3168822c-c8cd-4a46-9d28-82ec7a44f0d2"
                                }, 
                                {
                                    "direction": "ingress", 
                                    "ethertype": "IPv4", 
                                    "id": "e82a0b2b-2854-4ecb-ab32-c9b415310ed1", 
                                    "port_range_max": null, 
                                    "port_range_min": null, 
                                    "protocol": null, 
                                    "remote_ip_prefix": null, 
                                    "security_group_id": "3168822c-c8cd-4a46-9d28-82ec7a44f0d2"
                                }
                            ]
                        }
                    ], 
                    "status": "ACTIVE", 
                    "tenant_id": "c74b137638bf4eb2b62f3d18bbb88ae4", 
                    "updated": "2016-11-02T14:28:53Z", 
                    "user_id": "c4b89b1622cf4c21bb73865a55a856dd", 
                    "volumes": [
                        {
                            "HUMAN_ID": false, 
                            "NAME_ATTR": "name", 
                            "attachments": [
                                {
                                    "attached_at": "2016-11-02T14:32:33.000000", 
                                    "attachment_id": "771386ba-a28a-446b-b2d5-7748fec07dad", 
                                    "device": "/dev/vdb", 
                                    "host_name": null, 
                                    "id": "1b20cbcc-08ba-4247-a000-2fbcc66ad3c5", 
                                    "server_id": "22d67beb-8ad0-40a4-a85a-643c0ae847ca", 
                                    "volume_id": "1b20cbcc-08ba-4247-a000-2fbcc66ad3c5"
                                }
                            ], 
                            "availability_zone": "nova", 
                            "bootable": false, 
                            "consistencygroup_id": null, 
                            "created_at": "2016-11-02T14:30:05.000000", 
                            "description": null, 
                            "device": "/dev/vdb", 
                            "display_description": null, 
                            "display_name": "xxx-yyy-zzz-backup", 
                            "encrypted": false, 
                            "human_id": null, 
                            "id": "1b20cbcc-08ba-4247-a000-2fbcc66ad3c5", 
                            "links": [
                                {
                                    "href": "https://api.cbk.cloud.syseleven.net:8776/v2/c74b137638bf4eb2b62f3d18bbb88ae4/volumes/1b20cbcc-08ba-4247-a000-2fbcc66ad3c5", 
                                    "rel": "self"
                                }, 
                                {
                                    "href": "https://api.cbk.cloud.syseleven.net:8776/c74b137638bf4eb2b62f3d18bbb88ae4/volumes/1b20cbcc-08ba-4247-a000-2fbcc66ad3c5", 
                                    "rel": "bookmark"
                                }
                            ], 
                            "metadata": {
                                "attached_mode": "rw", 
                                "readonly": "False"
                            }, 
                            "multiattach": false, 
                            "name": "xxx-yyy-zzz-backup", 
                            "os-vol-tenant-attr:tenant_id": "c74b137638bf4eb2b62f3d18bbb88ae4", 
                            "replication_status": "disabled", 
                            "request_ids": [], 
                            "size": 1, 
                            "snapshot_id": null, 
                            "source_volid": null, 
                            "status": "in-use", 
                            "updated_at": "2016-11-02T14:32:33.000000", 
                            "user_id": "c4b89b1622cf4c21bb73865a55a856dd", 
                            "volume_type": "quobyte", 
                            "x_openstack_request_ids": []
                        }
                    ], 
                    "x_openstack_request_ids": []
                }, 
                "volume": {
                    "name": "backup", 
                    "size": 1
                }
            }
        ]
    }
}

@phongle1205
Copy link
Contributor Author

Migrated from ansible/ansible-modules-core#5465

@ansibot
Copy link
Contributor

ansibot commented Feb 17, 2017

@ansibot ansibot added cloud community_review In order to be merged, this PR must follow the community review workflow. feature_pull_request module This issue/PR relates to a module. openstack labels Feb 17, 2017
@ansibot ansibot assigned emonty and rcarrillocruz and unassigned emonty Feb 17, 2017
@ansibot ansibot added the affects_2.4 This issue/PR affects Ansible v2.4 label Mar 27, 2017
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 11, 2017
@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Jun 29, 2017
@rcarrillocruz rcarrillocruz self-requested a review August 10, 2017 18:21
@ansibot
Copy link
Contributor

ansibot commented Aug 26, 2017

@ansibot ansibot added the new_contributor This PR is the first contribution by a new community member. label Oct 18, 2017
@ansibot ansibot removed the new_contributor This PR is the first contribution by a new community member. label Nov 3, 2017
@ansibot ansibot added the new_contributor This PR is the first contribution by a new community member. label Jan 22, 2018
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 2, 2018
@ansibot
Copy link
Contributor

ansibot commented May 13, 2018

cc @omgjlk
click here for bot help

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed community_review In order to be merged, this PR must follow the community review workflow. support:community This issue/PR relates to code supported by the Ansible community. labels Sep 18, 2018
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. support:community This issue/PR relates to code supported by the Ansible community. and removed core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 4, 2018
@ansibot
Copy link
Contributor

ansibot commented Oct 12, 2018

cc @mnaser
click here for bot help

@mnaser
Copy link
Contributor

mnaser commented Oct 13, 2018

shipit

@samdoran
Copy link
Contributor

Please create a changelog fragment. See fragments for examples.

@ansibot
Copy link
Contributor

ansibot commented Nov 2, 2018

@ansibot
Copy link
Contributor

ansibot commented Apr 7, 2019

cc @gtema
click here for bot help

@Akasurde Akasurde force-pushed the ansible-modules-core/pull/5465 branch 2 times, most recently from 5fe16d3 to 2110e10 Compare October 20, 2019 04:56
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 20, 2019
@ansibot
Copy link
Contributor

ansibot commented Oct 20, 2019

The test ansible-test sanity --test no-smart-quotes [explain] failed with 1 error:

changelogs/fragments/os_server_volume.yml:2:55: use ASCII quotes `'` and `"` instead of Unicode quotes

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Oct 20, 2019
@opendev-zuul
Copy link

opendev-zuul bot commented Oct 20, 2019

Build succeeded (third-party-check pipeline).

…similar information

Currently, attach an attached volume from OpenStack VM’s returns only
argument data. It is better to return full data as attaching a detached
volume.

In my use case, I need the extra data to mount and format the volume.
@Akasurde Akasurde force-pushed the ansible-modules-core/pull/5465 branch from 2110e10 to 6c967fd Compare October 20, 2019 05:48
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 20, 2019
@opendev-zuul
Copy link

opendev-zuul bot commented Oct 20, 2019

Build succeeded (third-party-check pipeline).

@Akasurde Akasurde merged commit 331d51f into ansible:devel Oct 20, 2019
@Akasurde
Copy link
Member

@phongle1205 Thanks for the contribution.

@ansible ansible locked and limited conversation to collaborators Nov 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 cloud community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. new_contributor This PR is the first contribution by a new community member. openstack support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants