Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
openstack attach volume
# openstack --debug server add volume 80bde0e8-1c17-4c77-add1-49cfb75e19f7 723dd3bc-d67a-47e7-8cb7-32ddce80f810
WARNING: openstackclient.common.utils is deprecated and will be removed after Jun 2017. Please use osc_lib.utils
START with options: ['--debug', 'server', 'add', 'volume', '80bde0e8-1c17-4c77-add1-49cfb75e19f7', '723dd3bc-d67a-47e7-8cb7-32ddce80f810']
options: Namespace(access_key='', access_secret='***', access_token='***', access_token_endpoint='', access_token_type='', auth_type='', auth_url='http://192.168.0.2:35357/v2.0', authorization_code='', cacert='', cert='', client_id='', client_secret='***', cloud='', consumer_key='', consumer_secret='***', debug=True, default_domain='default', default_domain_id='', default_domain_name='', deferred_help=False, discovery_endpoint='', domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, interface='', key='', log_file=None, old_profile=None, os_alarming_api_version='2', os_beta_command=False, os_clustering_api_version='1', os_compute_api_version='', os_container_infra_api_version='1', os_data_processing_api_version='1.1', os_data_processing_url='', os_dns_api_version='2', os_identity_api_version='', os_image_api_version='', os_key_manager_api_version='1', os_network_api_version='', os_object_api_version='', os_orchestration_api_version='1', os_project_id=None, os_project_name=None, os_queues_api_version='2', os_volume_api_version='', os_workflow_api_version='2', passcode='', password='***', profile=None, project_domain_id='', project_domain_name='', project_id='', project_name='admin', protocol='', redirect_uri='', region_name='', roles='', scope='', timing=False, token='***', trust_id='', url='', user_domain_id='', user_domain_name='', user_id='', username='admin', verbose_level=3, verify=None)
defaults: {u'auth_type': 'password', u'status': u'active', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'api_timeout': None, u'baremetal_api_version': u'1', u'image_api_version': u'2', u'metering_api_version': u'2', u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': u'1', 'cacert': None, u'network_api_version': u'2', u'message': u'', u'image_format': u'qcow2', u'key_manager_api_version': u'v1', 'verify': True, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'cert': None, u'secgroup_source': u'neutron', u'container_api_version': u'1', u'dns_api_version': u'2', u'object_store_api_version': u'1', u'interface': None, u'disable_vendor_agent': {}}
cloud cfg: {'auth_type': 'password', 'beta_command': False, u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'data_processing_api_version': '1.1', u'network_api_version': u'2', u'message': u'', u'image_format': u'qcow2', 'networks': [], u'image_api_version': u'2', 'clustering_api_version': '1', 'verify': True, u'dns_api_version': '2', u'object_store_api_version': u'1', u'status': u'active', 'container_infra_api_version': '1', 'verbose_level': 3, 'region_name': '', 'api_timeout': None, u'baremetal_api_version': u'1', 'queues_api_version': '2', 'auth': {'username': 'admin', 'project_name': 'admin', 'password': '***', 'auth_url': 'http://192.168.0.2:35357/v2.0'}, 'default_domain': 'default', u'container_api_version': u'1', u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': '1', 'timing': False, 'cacert': None, u'key_manager_api_version': '1', u'metering_api_version': u'2', 'deferred_help': False, u'identity_api_version': u'2.0', 'workflow_api_version': '2', u'volume_api_version': u'2', 'cert': None, u'secgroup_source': u'neutron', 'alarming_api_version': '2', 'debug': True, u'interface': None, u'disable_vendor_agent': {}}
compute API version 2, cmd group openstack.compute.v2
network API version 2, cmd group openstack.network.v2
image API version 2, cmd group openstack.image.v2
volume API version 2, cmd group openstack.volume.v2
identity API version 2.0, cmd group openstack.identity.v2
object_store API version 1, cmd group openstack.object_store.v1
workflow_engine API version 2, cmd group openstack.workflow_engine.v2
container_infra API version 1, cmd group openstack.container_infra.v1
neutronclient API version 2, cmd group openstack.neutronclient.v2
data_processing API version 1.1, cmd group openstack.data_processing.v1
alarming API version 2, cmd group openstack.alarming.v2
dns API version 2, cmd group openstack.dns.v2
orchestration API version 1, cmd group openstack.orchestration.v1
clustering API version 1, cmd group openstack.clustering.v1
messaging API version 2, cmd group openstack.messaging.v2
key_manager API version 1, cmd group openstack.key_manager.v1
command: server add volume -> openstackclient.compute.v2.server.AddServerVolume
Auth plugin password selected
auth_type: password
Using auth plugin: password
Using parameters {'username': 'admin', 'password': '***', 'project_name': 'admin', 'user_id': None, 'default_domain_id': None, 'domain_name': None, 'auth_url': 'http://192.168.0.2:35357/v2.0', 'default_domain_name': None, 'project_id': None, 'domain_id': None, 'trust_id': None}
Get auth_ref
REQ: curl -g -i -X GET http://192.168.0.2:35357/v2.0 -H "Accept: application/json" -H "User-Agent: python-openstackclient keystoneauth1/2.12.1 python-requests/2.10.0 CPython/2.7.12"
Starting new HTTP connection (1): 192.168.0.2
"GET /v2.0 HTTP/1.1" 200 None
RESP: [200] Date: Fri, 21 Oct 2016 01:59:03 GMT Server: Apache Vary: X-Auth-Token,Accept-Encoding x-openstack-request-id: req-edb44564-4ef6-48d7-a078-a9a36d96c9bd Content-Encoding: gzip Connection: close Transfer-Encoding: chunked Content-Type: application/json
RESP BODY: {"version": {"status": "deprecated", "updated": "2016-08-04T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://192.168.0.2:35357/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}
Making authentication request to http://192.168.0.2:35357/v2.0/tokens
Resetting dropped connection: 192.168.0.2
"POST /v2.0/tokens HTTP/1.1" 200 None
run(Namespace(device=None, server='80bde0e8-1c17-4c77-add1-49cfb75e19f7', volume='723dd3bc-d67a-47e7-8cb7-32ddce80f810'))
Instantiating compute client for API Version Major: 2, Minor: 0
Instantiating volume client: <class 'cinderclient.v2.client.Client'>
Making authentication request to http://192.168.0.2:35357/v2.0/tokens
Resetting dropped connection: 192.168.0.2
"POST /v2.0/tokens HTTP/1.1" 200 None
REQ: curl -g -i -X GET http://74.001.001.4:8774/v2.1/servers/80bde0e8-1c17-4c77-add1-49cfb75e19f7 -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}72b87b13f75272d55ab466c379e8da49d7426215"
Starting new HTTP connection (1): 74.001.001.4
"GET /v2.1/servers/80bde0e8-1c17-4c77-add1-49cfb75e19f7 HTTP/1.1" 200 1695
RESP: [200] Content-Length: 1695 Content-Type: application/json Openstack-Api-Version: compute 2.1 X-Openstack-Nova-Api-Version: 2.1 Vary: OpenStack-API-Version, X-OpenStack-Nova-API-Version X-Compute-Request-Id: req-785ec2f3-5f8c-4a42-a149-de4210e02637 Date: Fri, 21 Oct 2016 01:59:04 GMT Connection: close
RESP BODY: {"server": {"OS-EXT-STS:task_state": null, "addresses": {"admin_internal_net": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:5c:58:d2", "version": 4, "addr": "192.168.111.9", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://74.001.001.4:8774/v2.1/servers/80bde0e8-1c17-4c77-add1-49cfb75e19f7", "rel": "self"}, {"href": "http://74.001.001.4:8774/servers/80bde0e8-1c17-4c77-add1-49cfb75e19f7", "rel": "bookmark"}], "image": {"id": "651414f4-e415-486f-8423-38337e3ab326", "links": [{"href": "http://74.001.001.4:8774/images/651414f4-e415-486f-8423-38337e3ab326", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-0000000c", "OS-SRV-USG:launched_at": "2016-10-20T02:35:18.000000", "flavor": {"id": "75a00365-f29f-4f8a-8ce7-78b8b5ec5bcb", "links": [{"href": "http://74.001.001.4:8774/flavors/75a00365-f29f-4f8a-8ce7-78b8b5ec5bcb", "rel": "bookmark"}]}, "id": "80bde0e8-1c17-4c77-add1-49cfb75e19f7", "security_groups": [{"name": "open"}], "user_id": "db2fd54547014d489942c63f96fcf315", "OS-DCF:diskConfig": "AUTO", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "OS-EXT-AZ:availability_zone": "nova", "metadata": {}, "status": "ACTIVE", "updated": "2016-10-21T00:03:25Z", "hostId": "b542d6f93a8d4eed9cbaa470d2b79df6defc61497894786511862390", "OS-EXT-SRV-ATTR:host": "node-3.dtac.io", "OS-SRV-USG:terminated_at": null, "key_name": "admin", "OS-EXT-SRV-ATTR:hypervisor_hostname": "node-3.dtac.io", "name": "meditrina_db", "created": "2016-10-20T02:34:34Z", "tenant_id": "64f7b2e6f00a4bcd9c896fd3fba7ed33", "os-extended-volumes:volumes_attached": [{"id": "dd76afad-ff33-4379-ab48-342c0c8674b0"}], "config_drive": "True"}}
GET call to compute for http://74.001.001.4:8774/v2.1/servers/80bde0e8-1c17-4c77-add1-49cfb75e19f7 used request id req-785ec2f3-5f8c-4a42-a149-de4210e02637
REQ: curl -g -i -X GET http://74.001.001.4:8776/v2/64f7b2e6f00a4bcd9c896fd3fba7ed33/volumes/723dd3bc-d67a-47e7-8cb7-32ddce80f810 -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}72b87b13f75272d55ab466c379e8da49d7426215"
Starting new HTTP connection (1): 74.001.001.4
"GET /v2/64f7b2e6f00a4bcd9c896fd3fba7ed33/volumes/723dd3bc-d67a-47e7-8cb7-32ddce80f810 HTTP/1.1" 200 1053
RESP: [200] X-Compute-Request-Id: req-61050bb1-644b-445f-91f6-ff140bf842a6 Content-Type: application/json Content-Length: 1053 X-Openstack-Request-Id: req-61050bb1-644b-445f-91f6-ff140bf842a6 Date: Fri, 21 Oct 2016 01:59:04 GMT Connection: close
RESP BODY: {"volume": {"migration_status": null, "attachments": [], "links": [{"href": "http://74.001.001.4:8776/v2/64f7b2e6f00a4bcd9c896fd3fba7ed33/volumes/723dd3bc-d67a-47e7-8cb7-32ddce80f810", "rel": "self"}, {"href": "http://74.001.001.4:8776/64f7b2e6f00a4bcd9c896fd3fba7ed33/volumes/723dd3bc-d67a-47e7-8cb7-32ddce80f810", "rel": "bookmark"}], "availability_zone": "nova", "os-vol-host-attr:host": "str:netapp@cinder_netapp#vol_openstack_admin01", "encrypted": false, "updated_at": "2016-10-21T01:40:10.000000", "replication_status": "disabled", "snapshot_id": null, "id": "723dd3bc-d67a-47e7-8cb7-32ddce80f810", "size": 3, "user_id": "db2fd54547014d489942c63f96fcf315", "os-vol-tenant-attr:tenant_id": "64f7b2e6f00a4bcd9c896fd3fba7ed33", "os-vol-mig-status-attr:migstat": null, "metadata": {}, "status": "available", "description": "", "multiattach": false, "source_volid": null, "consistencygroup_id": null, "os-vol-mig-status-attr:name_id": null, "name": "med_test", "bootable": "false", "created_at": "2016-10-21T01:04:46.000000", "volume_type": "netapp"}}
GET call to volumev2 for http://74.001.001.4:8776/v2/64f7b2e6f00a4bcd9c896fd3fba7ed33/volumes/723dd3bc-d67a-47e7-8cb7-32ddce80f810 used request id req-61050bb1-644b-445f-91f6-ff140bf842a6
REQ: curl -g -i -X POST http://74.001.001.4:8774/v2.1/servers/80bde0e8-1c17-4c77-add1-49cfb75e19f7/os-volume_attachments -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}72b87b13f75272d55ab466c379e8da49d7426215" -d '{"volumeAttachment": {"volumeId": "723dd3bc-d67a-47e7-8cb7-32ddce80f810"}}'
Resetting dropped connection: 74.001.001.4
"POST /v2.1/servers/80bde0e8-1c17-4c77-add1-49cfb75e19f7/os-volume_attachments HTTP/1.1" 200 194
RESP: [200] Content-Length: 194 Content-Type: application/json Openstack-Api-Version: compute 2.1 X-Openstack-Nova-Api-Version: 2.1 Vary: OpenStack-API-Version, X-OpenStack-Nova-API-Version X-Compute-Request-Id: req-5e728c4a-49d0-4175-b3ce-b3aaaa31d2a9 Date: Fri, 21 Oct 2016 01:59:04 GMT Connection: close
RESP BODY: {"volumeAttachment": {"device": "/dev/vdc", "serverId": "80bde0e8-1c17-4c77-add1-49cfb75e19f7", "id": "723dd3bc-d67a-47e7-8cb7-32ddce80f810", "volumeId": "723dd3bc-d67a-47e7-8cb7-32ddce80f810"}}
POST call to compute for http://74.001.001.4:8774/v2.1/servers/80bde0e8-1c17-4c77-add1-49cfb75e19f7/os-volume_attachments used request id req-5e728c4a-49d0-4175-b3ce-b3aaaa31d2a9
clean_up AddServerVolume:
END return value: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.