cinder-admin
一、通过cinder-api获取信息:
1.登录控制节点(安装keystone即可)
获取cinder-api地址
keystone endpoint-get --service volume keystone endpoint-get --service volumev2
+--------------------+-----------------------------------------------------------------------+ | Property | Value | +--------------------+-----------------------------------------------------------------------+ | volumev2.publicURL | http://ceph4:8776/v2/99effc7dba13435a93924dbe866ede16 | +--------------------+-----------------------------------------------------------------------+
2.获取token(tenant为admin)
keystone token-get
3.获取cinder接口信息
cat curl-cinder.sh #!/bin/bash source /root/source/admin-openrc.sh IP='10.1.1.11' PORT='8776' tenant_id='c1e6cbf1502141dca4a70c7f500688f3' token_id='gAAAAABdDEt_Os69P2okx-mQN2PBTi0eHifPvyIul1bQwQ3znE9_v9XgYR3GJMkwU_-7FBiQlyjemX_FtIIf00REO3gf4hOwSAdzdHUHNReI3d36dzo0oZJ5jz-yOv1eX3YEu2M3wWIAvgCyNYyGFTp03twfn7qCN2oImdrwyGccbav0XtW5rEA' curl -g -i -X GET http://$IP:$PORT/v2/$tenant_id/scheduler-stats/get_pools?detail=true -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: $token_id"
输出
{
"pools": [
{
"capabilities": {
"allocated_capacity_gb": 0,
"backend_state": "up",
"driver_version": "1.2.0",
"filter_function": null,
"free_capacity_gb": 10.85,
"goodness_function": null,
"location_info": "ceph:/etc/ceph/ceph.conf:1f0490cd-f938-4e20-8ea5-d817d941a6e6:None:volumes",
"max_over_subscription_ratio": "10.0",
"multiattach": false,
"provisioned_capacity_gb": 4.0,
"replication_enabled": false,
"reserved_percentage": 0,
"storage_protocol": "ceph",
"thin_provisioning_support": true,
"timestamp": "2019-06-21T03:16:26.207272",
"total_capacity_gb": 10.85,
"vendor_name": "Open Source",
"volume_backend_name": "ceph-data-backend"
},
"name": "ceph3@ceph-data01#ceph-data-backend"
},
{
"capabilities": {
"allocated_capacity_gb": 2,
"backend_state": "up",
"driver_version": "1.2.0",
"filter_function": null,
"free_capacity_gb": 10.85,
"goodness_function": null,
"location_info": "ceph:/etc/ceph/ceph.conf:1f0490cd-f938-4e20-8ea5-d817d941a6e6:None:volumes",
"max_over_subscription_ratio": "10.0",
"multiattach": false,
"provisioned_capacity_gb": 4.0,
"replication_enabled": false,
"reserved_percentage": 0,
"storage_protocol": "ceph",
"thin_provisioning_support": true,
"timestamp": "2019-06-21T03:16:19.732473",
"total_capacity_gb": 10.85,
"vendor_name": "Open Source",
"volume_backend_name": "ceph-data-backend"
},
"name": "ceph3@ceph-data#ceph-data-backend"
},
{
"capabilities": {
"allocated_capacity_gb": 2,
"backend_state": "up",
"driver_version": "1.2.0",
"filter_function": null,
"free_capacity_gb": 10.85,
"goodness_function": null,
"location_info": "ceph:/etc/ceph/ceph.conf:1f0490cd-f938-4e20-8ea5-d817d941a6e6:None:volumes",
"max_over_subscription_ratio": "10.0",
"multiattach": false,
"provisioned_capacity_gb": 4.0,
"replication_enabled": false,
"reserved_percentage": 0,
"storage_protocol": "ceph",
"thin_provisioning_support": true,
"timestamp": "2019-06-21T03:16:25.953332",
"total_capacity_gb": 10.85,
"vendor_name": "Open Source",
"volume_backend_name": "ceph-cache-backend"
},
"name": "ceph3@ceph-cache#ceph-cache-backend"
},
{
"capabilities": {
"QoS_support": false,
"allocated_capacity_gb": 1,
"backend_state": "up",
"driver_version": "3.0.0",
"filter_function": null,
"free_capacity_gb": 1.9,
"goodness_function": null,
"location_info": "LVMVolumeDriver:ceph3:cinder-volumes:thin:0",
"max_over_subscription_ratio": "20.0",
"multiattach": true,
"pool_name": "LVM",
"provisioned_capacity_gb": 1.0,
"reserved_percentage": 0,
"storage_protocol": "iSCSI",
"thick_provisioning_support": false,
"thin_provisioning_support": true,
"timestamp": "2019-06-21T03:16:19.321248",
"total_capacity_gb": 1.9,
"total_volumes": 2,
"vendor_name": "Open Source",
"volume_backend_name": "LVM"
},
"name": "ceph3@lvm#LVM"
}
]
}
4.获取glance接口信息
cat curl-glance.sh #!/bin/bash source /root/source/admin-openrc.sh IP='10.1.1.11' PORT='9292' tenant_id='c1e6cbf1502141dca4a70c7f500688f3' token_id='gAAAAABdDEt_Os69P2okx-mQN2PBTi0eHifPvyIul1bQwQ3znE9_v9XgYR3GJMkwU_-7FBiQlyjemX_FtIIf00REO3gf4hOwSAdzdHUHNReI3d36dzo0oZJ5jz-yOv1eX3YEu2M3wWIAvgCyNYyGFTp03twfn7qCN2oImdrwyGccbav0XtW5rEA' curl -g -i -X GET http://$IP:$PORT/v2/schemas/images?detail=true -H "User-Agent: python-glanceclient" -H "Accept: application/json" -H "X-Auth-Token: $token_id"
输出:
{
"links": [
{
"href": "{first}",
"rel": "first"
},
{
"href": "{next}",
"rel": "next"
},
{
"href": "{schema}",
"rel": "describedby"
}
],
"name": "images",
"properties": {
"first": {
"type": "string"
},
"images": {
"items": {
"additionalProperties": {
"type": "string"
},
"links": [
{
"href": "{self}",
"rel": "self"
},
{
"href": "{file}",
"rel": "enclosure"
},
{
"href": "{schema}",
"rel": "describedby"
}
],
"name": "image",
"properties": {
"architecture": {
"description": "Operating system architecture as specified in https://docs.openstack.org/python-glanceclient/latest/cli/property-keys.html",
"is_base": false,
"type": "string"
},
"backend": {
"description": "Backend store to upload image to",
"readOnly": true,
"type": "string"
},
"checksum": {
"description": "md5 hash of image contents.",
"maxLength": 32,
"readOnly": true,
"type": [
"null",
"string"
]
},
"container_format": {
"description": "Format of the container",
"enum": [
null,
"ami",
"ari",
"aki",
"bare",
"ovf",
"ova",
"docker"
],
"type": [
"null",
"string"
]
},
"created_at": {
"description": "Date and time of image registration",
"readOnly": true,
"type": "string"
},
"direct_url": {
"description": "URL to access the image file kept in external store",
"readOnly": true,
"type": "string"
},
"disk_format": {
"description": "Format of the disk",
"enum": [
null,
"ami",
"ari",
"aki",
"vhd",
"vhdx",
"vmdk",
"raw",
"qcow2",
"vdi",
"iso",
"ploop"
],
"type": [
"null",
"string"
]
},
"file": {
"description": "An image file url",
"readOnly": true,
"type": "string"
},
"id": {
"description": "An identifier for the image",
"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
"type": "string"
},
"instance_uuid": {
"description": "Metadata which can be used to record which instance this image is associated with. (Informational only, does not create an instance snapshot.)",
"is_base": false,
"type": "string"
},
"kernel_id": {
"description": "ID of image stored in Glance that should be used as the kernel when booting an AMI-style image.",
"is_base": false,
"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
"type": [
"null",
"string"
]
},
"locations": {
"description": "A set of URLs to access the image file kept in external store",
"items": {
"properties": {
"metadata": {
"type": "object"
},
"url": {
"maxLength": 255,
"type": "string"
}
},
"required": [
"url",
"metadata"
],
"type": "object"
},
"type": "array"
},
"min_disk": {
"description": "Amount of disk space (in GB) required to boot image.",
"type": "integer"
},
"min_ram": {
"description": "Amount of ram (in MB) required to boot image.",
"type": "integer"
},
"name": {
"description": "Descriptive name for the image",
"maxLength": 255,
"type": [
"null",
"string"
]
},
"os_distro": {
"description": "Common name of operating system distribution as specified in https://docs.openstack.org/python-glanceclient/latest/cli/property-keys.html",
"is_base": false,
"type": "string"
},
"os_hash_algo": {
"description": "Algorithm to calculate the os_hash_value",
"maxLength": 64,
"readOnly": true,
"type": [
"null",
"string"
]
},
"os_hash_value": {
"description": "Hexdigest of the image contents using the algorithm specified by the os_hash_algo",
"maxLength": 128,
"readOnly": true,
"type": [
"null",
"string"
]
},
"os_hidden": {
"description": "If true, image will not appear in default image list response.",
"type": "boolean"
},
"os_version": {
"description": "Operating system version as specified by the distributor",
"is_base": false,
"type": "string"
},
"owner": {
"description": "Owner of the image",
"maxLength": 255,
"type": [
"null",
"string"
]
},
"protected": {
"description": "If true, image will not be deletable.",
"type": "boolean"
},
"ramdisk_id": {
"description": "ID of image stored in Glance that should be used as the ramdisk when booting an AMI-style image.",
"is_base": false,
"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
"type": [
"null",
"string"
]
},
"schema": {
"description": "An image schema url",
"readOnly": true,
"type": "string"
},
"self": {
"description": "An image self url",
"readOnly": true,
"type": "string"
},
"size": {
"description": "Size of image file in bytes",
"readOnly": true,
"type": [
"null",
"integer"
]
},
"status": {
"description": "Status of the image",
"enum": [
"queued",
"saving",
"active",
"killed",
"deleted",
"uploading",
"importing",
"pending_delete",
"deactivated"
],
"readOnly": true,
"type": "string"
},
"tags": {
"description": "List of strings related to the image",
"items": {
"maxLength": 255,
"type": "string"
},
"type": "array"
},
"updated_at": {
"description": "Date and time of the last image modification",
"readOnly": true,
"type": "string"
},
"virtual_size": {
"description": "Virtual size of image in bytes",
"readOnly": true,
"type": [
"null",
"integer"
]
},
"visibility": {
"description": "Scope of image accessibility",
"enum": [
"community",
"public",
"private",
"shared"
],
"type": "string"
}
}
},
"type": "array"
},
"next": {
"type": "string"
},
"schema": {
"type": "string"
}
}
}

浙公网安备 33010602011771号