查看rabbitmq 队列:rabbitmqctl list_queues [root@controller ~]# rabbitmqctl list_queues Listing queues reply_56e60e52bf7145a3b6b5e1d54b633599 0 q-agent-notifier-binding-activate.node2 0 q-agent-notifier-port-update_fanout_1fa7ca53d470470b8c4fe240bf73a567 0 reply_752f5636dc114913b9430c5f76182b9a 0 q-agent-notifier-port-update_fanout_b38b3e13404f4490819bb4ee89141c55 0 q-agent-notifier-network-update.controller 0 q-agent-notifier-binding-activate_fanout_ee07343186f345f1ae54da1ed67c0fd5 0 l3_agent 0 conductor_fanout_a624520fb9584b63b857d02e2af6fbb3 0 scheduler_fanout_7ceb912850054ac4b8ef72456b307244 0 scheduler_fanout_dbf1f1c1af394815b8adb07258a36e82 0 reply_c395cbc019b14012b223cba4a6a1fa3b 0 cinder-volume.node2@ceph_fanout_3604cfb573664ffd8ee7fcbf1ea97f20 0 compute.node1 0 q-agent-notifier-l2population-update.controller 0 q-agent-notifier-binding-deactivate.node1 0 reply_cbefdb394e2e4d54a33ecb6be428edf4 0 reply_9d4ce6a302274e8c9ec32a6054ff8843 0 neutron-vo-QosPolicy-1.7_fanout_4a9fb7ca423f4546a795336440db7a4a 0 q-agent-notifier-security_group-update.node3 0 reply_59c0939282504e43895fb231a6918c7c 0 q-reports-plugin 0 consoleauth_fanout_83a5253d7f174a7fb38f2f23b2d4229d 0 q-agent-notifier-binding-deactivate_fanout_2c436b3fee8d4064a54bcafd054317b3 0 neutron-vo-QosPolicy-1.7 0 q-agent-notifier-port-update 0 cinder-volume.node2@ceph-ssd_fanout_27c556750dcf4613b0ab406924c8118e 0 scheduler 0 neutron-vo-SubPort-1.0 0
查看keystone的用户:K版之后使用openstack user list
[root@controller ~]# openstack user list | |
---|---|
ID | Name |
06a72bdd76d247fca8328ee17360449e | admin |
0e1f815fde9b48d6b90727b5c7730478 | glance |
6836dfd555ee4df788f268948c1105b7 | neutron |
75557b1b240e4fe5bba190edb90dd8cc | placement |
99c1e22bd4944c6a8e92b1b290b77dfc | cinder |
cffad667559c4d438310fdddfafd181b | nova |
fad5b40bac5649b4a55cdaa72b2dc086 | myuser |
[root@controller ~]# . admin-openrc
[root@controller ~]# openstack network list | ||
---|---|---|
ID | Name | Subnets |
0419d666-2a1e-4c5f-9331-b54ab7718b8b | public | e97beba0-d8ae-4bc6-9497-abad9200cb60 |
36878f8d-9df4-4e8a-9972-4c236d9c9eca | private | 2e2086da-6acb-499e-a22e-a3906bcf48e7 |
查看keystone endpoint: K版之后使用openstack endpoint list
[root@controller ~]# openstack endpoint list | ||||||
---|---|---|---|---|---|---|
ID | Region | Service Name | Service Type | Enabled | Interface | URL |
0cd1950349834be49483875e3f5474ba | RegionOne | placement | placement | True | internal | http://controller:8778 |
2786757737b249baab4de9c05c4fbb7f | RegionOne | keystone | identity | True | public | http://controller:5000/v3/ |
3c875a0eadd14607a3f73619bd8fa2d1 | RegionOne | cinderv3 | volumev3 | True | internal | http://controller:8776/v3/%(project_id)s |
3faa7cc33e7f4b5e9742747abf105ba4 | RegionOne | neutron | network | True | public | http://controller:9696 |
43f752d43b804301bd15274109b663f0 | RegionOne | nova | compute | True | admin | http://controller:8774/v2.1 |
5811d2b92d4542dc9f3c9fadad3f064e | RegionOne | cinderv2 | volumev2 | True | internal | http://controller:8776/v2/%(project_id)s |
58d82677a1774405a34b8a5e5e4013ef | RegionOne | nova | compute | True | public | http://controller:8774/v2.1 |
5fa3c0f9c20d4e1c945eed811a263cf3 | RegionOne | glance | image | True | internal | http://controller:9292 |
603b62f28e5044db9c43956bb891629d | RegionOne | cinderv2 | volumev2 | True | public | http://controller:8776/v2/%(project_id)s |
6d1c6573ac004176b8f13ba857fbf07e | RegionOne | glance | image | True | admin | http://controller:9292 |
6dc5f0b32eb047efad80977514970fb3 | RegionOne | neutron | network | True | internal | http://controller:9696 |
8473785f9827495cad7a04d670d75b38 | RegionOne | placement | placement | True | admin | http://controller:8778 |
a7762643543a4ad6b6b52fb24d3911ad | RegionOne | keystone | identity | True | internal | http://controller:5000/v3/ |
b7caa18f6c154565aaa975e419e245c3 | RegionOne | keystone | identity | True | admin | http://controller:5000/v3/ |
b831ea4ccccb416aab02e23bd6cb7f67 | RegionOne | glance | image | True | public | http://controller:9292 |
be14eef12ddb4c0882f0dc33ced08b2c | RegionOne | cinderv3 | volumev3 | True | public | http://controller:8776/v3/%(project_id)s |
c17ac179dad2422eabf1378340444547 | RegionOne | neutron | network | True | admin | http://controller:9696 |
c7115af37def44faaf2684df7d22952f | RegionOne | nova | compute | True | internal | http://controller:8774/v2.1 |
d7565fe2f8ce4b5582928125def20c38 | RegionOne | cinderv2 | volumev2 | True | admin | http://controller:8776/v2/%(project_id)s |
db525259774f4f23928efc839c082a5f | RegionOne | placement | placement | True | public | http://controller:8778 |
e7b3df7459de4af495da605a1b5b4f5a | RegionOne | cinderv3 | volumev3 | True | admin | http://controller:8776/v3/%(project_id)s |
查看keystone的role:K版之后使用openstack role list
[root@controller ~]# openstack role list | |
---|---|
ID | Name |
2e227c837d0741c0b5c854f82a0a1cae | admin |
32c153c3ecfd4bc0ad425f796b5acf11 | myrole |
576f58a9b30b43ca9fb69ddfc48484a7 | member |
84268da464474db6acf643e6ee724e1d | reader |
查看keystone 服务:K版之后使用openstack service list
[root@controller ~]# openstack service list | ||
---|---|---|
ID | Name | Type |
081d39377c284ef29a73d10a27838e2e | cinderv2 | volumev2 |
1ccff6c226f145dfb0570cb4a4e09846 | nova | compute |
4ef6ede7946048abb49c927c7fab33f4 | neutron | network |
626253356157465798670ae98f6bb5da | glance | image |
63337a0205594b3781e6df37b483f46e | cinderv3 | volumev3 |
9b5e533bcc9c4ca1af1ce9f57d43050d | keystone | identity |
cb3e985c43eb4dca9491f2cd81fb75c9 | placement | placement |
查看keystone租户:K版之后使用openstack project list
[root@controller ~]# openstack project list | |
---|---|
ID | Name |
ad8d7966165b4619aab21300e50f7020 | service |
b03aac1f6ae94f7bada2afa8f2064312 | admin |
bdc7f07c4d2c42439d3f4ecb4a3d7b59 | myproject |
查看租户服务
[root@controller ~]# openstack project show service | |
---|---|
Field | Value |
description | Service Project |
domain_id | default |
enabled | True |
id | ad8d7966165b4619aab21300e50f7020 |
is_domain | False |
name | service |
parent_id | default |
tags | [] |
增加
创建域 。openstack project --domain 域 --description “描述” 项目名
[root@controller openstack]# openstack domain create --description "Test Domain" test | |
---|---|
Field | Value |
description | Test Domain |
enabled | True |
id | 2df857d76a6a45618fb7f44df7f4bf30 |
name | test |
创建项目(租户)。openstack project --domain 域 --description “描述” 项目名
[root@controller openstack]# openstack project create --domain test --description "Test Project" projectTest | |
---|---|
Field | Value |
description | Test Project |
domain_id | 2df857d76a6a45618fb7f44df7f4bf30 |
enabled | True |
id | e8a9be8ed46c42a5b2ec4af4e3ea84b0 |
is_domain | False |
name | projectTest |
parent_id | 2df857d76a6a45618fb7f44df7f4bf30 |
创建用户。openstack user create --domain 域 --password-prompt 用户名 [root@controller openstack]# openstack user create --domain test --password-prompt admin User Password:
Repeat User Password: | |
---|---|
Field | Value |
domain_id | 2df857d76a6a45618fb7f44df7f4bf30 |
enabled | True |
id | 954e3d42d4414f69875867e8cab1c0a8 |
name | admin |
创建角色。 openstack role create 角色名
[root@controller openstack]# openstack role create Admin1 | |
---|---|
Field | Value |
domain_id | None |
id | e638fe3a771844bc9b51fd704e60ccb1 |
name | Admin1 |
为某项目中的某用户指定角色。openstack role add --project 项目 --user 角色名用户ID 项目名项目ID [root@controller openstack]# openstack role add --project projectTest --user admin Admin1
其他组件的keystone配置
为组件创建用户。openstack user create --domain 域 --password-prompt 组件用户名 [root@controller openstack]# openstack user create --domain test --password-prompt admin User Password:
Repeat User Password: | |
---|---|
Field | Value |
domain_id | 2df857d76a6a45618fb7f44df7f4bf30 |
enabled | True |
id | 954e3d42d4414f69875867e8cab1c0a8 |
name | admin |
将组件用户添加到service项目的admin角色中 openstack role add --project service --user 组件用户名 admin
[root@controller openstack]# openstack service create --name serviceTest --description "service test" type | |
---|---|
Field | Value |
description | service test |
enabled | True |
id | 2776eda9d859402aa3e969b0b4611073 |
name | serviceTest |
type | type |
创建服务API
删除
删除服务。 openstack service delete 服务名服务ID openstack role remove --project projectTest --user admin Admin1
删除某角色。 openstack role delete 角色名ID 删除某用户 。openstack user delete 用户名ID 删除某项目。 openstack project delete 项目名ID 删除域。 [root@controller openstack]# openstack domain set --disable test [root@controller openstack]# openstack domain delete test
[root@controller openstack]# openstack domain list | |||
---|---|---|---|
ID | Name | Enabled | Description |
ab355ba21130434bbe54adcf0723713d | default | True | Default Domain |
查询
查看image:glance image-list 、openstack image list、nova image-list
[root@controller openstack]# nova image-list | |||
---|---|---|---|
ID | Name | Status | Server |
c4d5f159-e1d9-4033-9e11-f9d1b63a777a | cirros | ACTIVE |
[root@controller openstack]# glance image-list | |
---|---|
ID | Name |
c4d5f159-e1d9-4033-9e11-f9d1b63a777a | cirros |
[root@controller openstack]# openstack image list | ||
---|---|---|
ID | Name | Status |
c4d5f159-e1d9-4033-9e11-f9d1b63a777a | cirros | active |
查看image具体信息:openstack image show ID
[root@controller openstack]# openstack image show c4d5f159-e1d9-4033-9e11-f9d1b63a777a | |
---|---|
Field | Value |
checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
container_format | bare |
created_at | 2017-08-16T02:52:58Z |
disk_format | qcow2 |
file | /v2/images/c4d5f159-e1d9-4033-9e11-f9d1b63a777a/file |
id | c4d5f159-e1d9-4033-9e11-f9d1b63a777a |
min_disk | 0 |
min_ram | 0 |
name | cirros |
owner | f2c087c678a446929110f5fe67b456ee |
protected | False |
schema | /v2/schemas/image |
size | 13287936 |
status | active |
tags | |
updated_at | 2017-08-16T02:52:59Z |
virtual_size | None |
visibility | public |
错误检测
镜像上传后存放在/var/lib/glance/images中
nova
查看
查看nova 服务:nova-manage service list、openstack compute service list [root@controller openstack]# nova-manage service list DEPRECATED: Use the nova service-* commands from python-novaclient instead or the os-services REST resource. The service subcommand will be removed in the 14.0 release. Binary Host Zone Status State Updated_At nova-scheduler controller internal enabled :-) 2017-08-25 09:13:25 nova-conductor controller internal enabled :-) 2017-08-25 09:13:24 nova-consoleauth controller internal enabled :-) 2017-08-25 09:13:25 nova-osapi_compute 0.0.0.0 internal enabled XXX None nova-metadata 0.0.0.0 internal enabled XXX None nova-compute compute1 nova enabled :-) 2017-08-25 09:13:22
[root@controller openstack]# openstack compute service list | ||||||
---|---|---|---|---|---|---|
Id | Binary | Host | Zone | Status | State | Updated At |
1 | nova-scheduler | controller | internal | enabled | up | 2017-08-25T09:16:55.000000 |
2 | nova-conductor | controller | internal | enabled | up | 2017-08-25T09:16:54.000000 |
8 | nova-consoleauth | controller | internal | enabled | up | 2017-08-25T09:16:55.000000 |
18 | nova-compute | compute1 | nova | enabled | up | 2017-08-25T09:16:52.000000 |
设置安全组规则 设置默认安全组虚拟机能ssh: nova secgroup-add-rule default tcp 22 22 0.0.0.0/0 openstack security group rule create --proto tcp --dst-port 22 default
设置虚拟机能ping icmp包 nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0 openstack security group rule create --proto icmp default
显示安全组列表nova secgroup-list、openstack security group list
[root@controller openstack]# openstack security group list | |||
---|---|---|---|
ID | Name | Description | Project |
403d6083-a10f-469e-89ea-bf6247ebdf36 | default | Default security group | f2c087c678a446929110f5fe67b456ee |
[root@controller openstack]# nova secgroup-list | ||
---|---|---|
Id | Name | Description |
403d6083-a10f-469e-89ea-bf6247ebdf36 | default | Default security group |
-------------------------------------- --------- ------------------------
显示安全组规则 nova secgroup-list-rules default
[root@controller openstack]# nova secgroup-list-rules default | ||||
---|---|---|---|---|
IP Protocol | From Port | To Port | IP Range | Source Group |
default | ||||
tcp | 22 | 22 | 0.0.0.0/0 | |
icmp | -1 | -1 | 0.0.0.0/0 | |
default |
查看虚拟机配置种类:nova flavor-list
[root@controller openstack]# nova flavor-list、openstack flavor list | ||||||||
---|---|---|---|---|---|---|---|---|
ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
0 | m1.nano | 64 | 1 | 0 | 1 | 1.0 | True | |
1 | m1.tiny | 512 | 1 | 0 | 1 | 1.0 | True | |
2 | m1.small | 2048 | 20 | 0 | 1 | 1.0 | True | |
3 | m1.medium | 4096 | 40 | 0 | 2 | 1.0 | True | |
4 | m1.large | 8192 | 80 | 0 | 4 | 1.0 | True | |
5 | m1.xlarge | 16384 | 160 | 0 | 8 | 1.0 | True |
[root@controller openstack]# openstack flavor list | ||||||
---|---|---|---|---|---|---|
ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
0 | m1.nano | 64 | 1 | 0 | 1 | True |
1 | m1.tiny | 512 | 1 | 0 | 1 | True |
2 | m1.small | 2048 | 20 | 0 | 1 | True |
3 | m1.medium | 4096 | 40 | 0 | 2 | True |
4 | m1.large | 8192 | 80 | 0 | 4 | True |
5 | m1.xlarge | 16384 | 160 | 0 | 8 | True |
查看云系统中有哪些服务器 nova-manage service list |sort [root@controller openstack]# nova-manage service list|sort Binary Host Zone Status State Updated_At nova-compute compute1 nova enabled :-) 2017-08-30 02:42:47 nova-conductor controller internal enabled :-) 2017-08-30 02:42:45 nova-consoleauth controller internal enabled :-) 2017-08-30 02:42:46 nova-metadata 0.0.0.0 internal enabled XXX None nova-osapi_compute 0.0.0.0 internal enabled XXX None nova-scheduler controller internal enabled :-) 2017-08-30 02:42:46
查看nova版本 nova-manage --version nova-manage --version 13.1.4
虚拟机控制命令
查看虚拟机:nova list、openstack server list
[root@controller openstack]# nova list | |||||
---|---|---|---|---|---|
ID | Name | Status | Task State | Power State | Networks |
3724c84e-ef2d-48eb-a130-eb078d7622fe | provider-instance | ERROR | - | NOSTATE | provider=192.168.1.102 |
84cd0fc6-3704-4756-9f27-27bbe43bb980 | provider-instance | SHUTOFF | - | Shutdown | provider=192.168.1.105 |
[root@controller openstack]# openstack server list | |||
---|---|---|---|
ID | Name | Status | Networks |
84cd0fc6-3704-4756-9f27-27bbe43bb980 | provider-instance | SHUTOFF | provider=192.168.1.105 |
3724c84e-ef2d-48eb-a130-eb078d7622fe | provider-instance | ERROR | provider=192.168.1.102 |
删除虚拟机:nova delete ID、openstack server delete ID | |||
---|---|---|---|
ID | Name | Status | Networks |
84cd0fc6-3704-4756-9f27-27bbe43bb980 | provider-instance | SHUTOFF | provider=192.168.1.105 |
3724c84e-ef2d-48eb-a130-eb078d7622fe | provider-instance | ERROR | provider=192.168.1.102 |
[root@controller openstack]# openstack server delete 3724c84e-ef2d-48eb-a130-eb078d7622fe
[root@controller openstack]# openstack server list | |||
---|---|---|---|
ID | Name | Status | Networks |
84cd0fc6-3704-4756-9f27-27bbe43bb980 | provider-instance | SHUTOFF | provider=192.168.1.105 |
创建snapshot nova image-create 7eb1d4b3-13fa-4e39-be17-3a27eb0db218 “snapshot 1”
[root@controller openstack]# nova image-list | |||
---|---|---|---|
ID | Name | Status | Server |
c4d5f159-e1d9-4033-9e11-f9d1b63a777a | cirros | ACTIVE | |
4ee5c4be-3edf-431f-bc74-46d38ae7ebff | snapshot1 | ACTIVE | 84cd0fc6-3704-4756-9f27-27bbe43bb980 |
[root@controller openstack]# openstack server list | |||
---|---|---|---|
ID | Name | Status | Networks |
84cd0fc6-3704-4756-9f27-27bbe43bb980 | provider-instance | SHUTOFF | provider=192.168.1.105 |
[root@controller openstack]# nova image-create 84cd0fc6-3704-4756-9f27-27bbe43bb980 "snapshot 2"
[root@controller openstack]# openstack image list | ||
---|---|---|
ID | Name | Status |
6ff0c7eb-4214-43ce-a07c-b111beb6e90a | snapshot 2 | active |
4ee5c4be-3edf-431f-bc74-46d38ae7ebff | snapshot1 | active |
c4d5f159-e1d9-4033-9e11-f9d1b63a777a | cirros | active |
虚拟机重启,停止: nova suspend 84cd0fc6-3704-4756-9f27-27bbe43bb980
nova resume 84cd0fc6-3704-4756-9f27-27bbe43bb980
nova reboot 84cd0fc6-3704-4756-9f27-27bbe43bb980
openstack server suspend 84cd0fc6-3704-4756-9f27-27bbe43bb980
openstack server resume 84cd0fc6-3704-4756-9f27-27bbe43bb980
openstack server reboot 84cd0fc6-3704-4756-9f27-27bbe43bb980
openstack server start 84cd0fc6-3704-4756-9f27-27bbe43bb980
[root@controller openstack]# openstack server list | |||
---|---|---|---|
ID | Name | Status | Networks |
84cd0fc6-3704-4756-9f27-27bbe43bb980 | provider-instance | ACTIVE | provider=192.168.1.105 |
获取实例的CPU、内存、磁盘I/O等信息。 nova diagnostics serverID
nova diagnostics a55aeb82-303c-4bdc-92d2-280573a2ff8d | |
---|---|
Property | Value |
cpu0_time | 5613600000000 |
memory | 524288 |
memory-actual | 524288 |
memory-rss | 72672 |
tapefb0d3f7-56_rx | 90 |
tapefb0d3f7-56_rx_drop | 0 |
tapefb0d3f7-56_rx_errors | 0 |
tapefb0d3f7-56_rx_packets | 1 |
tapefb0d3f7-56_tx | 0 |
tapefb0d3f7-56_tx_drop | 0 |
tapefb0d3f7-56_tx_errors | 0 |
tapefb0d3f7-56_tx_packets | 0 |
vda_errors | -1 |
vda_read | 1024 |
vda_read_req | 2 |
vda_write | 0 |
vda_write_req | 0 |
查询实例的创建信息 nova show serverID
[root@controller openstack]# nova show a55aeb82-303c-4bdc-92d2-280573a2ff8d | |
---|---|
Property | Value |
OS-DCF:diskConfig | MANUAL |
OS-EXT-AZ:availability_zone | nova |
OS-EXT-SRV-ATTR:host | compute1 |
OS-EXT-SRV-ATTR:hostname | provider-instance |
OS-EXT-SRV-ATTR:hypervisor_hostname | compute1 |
OS-EXT-SRV-ATTR:instance_name | instance-00000003 |
OS-EXT-SRV-ATTR:kernel_id | |
OS-EXT-SRV-ATTR:launch_index | 0 |
OS-EXT-SRV-ATTR:ramdisk_id | |
OS-EXT-SRV-ATTR:reservation_id | r-b60qsvae |
OS-EXT-SRV-ATTR:root_device_name | /dev/vda |
OS-EXT-SRV-ATTR:user_data | - |
OS-EXT-STS:power_state | 1 |
OS-EXT-STS:task_state | - |
OS-EXT-STS:vm_state | active |
OS-SRV-USG:launched_at | 2017-08-30T03:16:57.000000 |
OS-SRV-USG:terminated_at | - |
accessIPv4 | |
accessIPv6 | |
config_drive | |
created | 2017-08-30T03:16:44Z |
description | provider-instance |
flavor | m1.tiny (1) |
hostId | 313f16dfa039b6343dadaa99f596545021ce67260dc5b91e2fe9bcc2 |
host_status | UP |
id | a55aeb82-303c-4bdc-92d2-280573a2ff8d |
image | cirros (c4d5f159-e1d9-4033-9e11-f9d1b63a777a) |
key_name | mykey |
locked | False |
metadata | {} |
name | provider-instance |
os-extended-volumes:volumes_attached | [] |
progress | 0 |
provider network | 192.168.1.106 |
security_groups | default |
status | ACTIVE |
tenant_id | f2c087c678a446929110f5fe67b456ee |
updated | 2017-08-30T03:16:57Z |
user_id | cd4defe69232424e864726ebd078c010 |
[root@controller openstack]# openstack server show serverID | |
---|---|
Field | Value |
OS-DCF:diskConfig | MANUAL |
OS-EXT-AZ:availability_zone | nova |
OS-EXT-SRV-ATTR:host | compute1 |
OS-EXT-SRV-ATTR:hypervisor_hostname | compute1 |
OS-EXT-SRV-ATTR:instance_name | instance-00000003 |
OS-EXT-STS:power_state | 1 |
OS-EXT-STS:task_state | None |
OS-EXT-STS:vm_state | active |
OS-SRV-USG:launched_at | 2017-08-30T03:16:57.000000 |
OS-SRV-USG:terminated_at | None |
accessIPv4 | |
accessIPv6 | |
addresses | provider=192.168.1.106 |
config_drive | |
created | 2017-08-30T03:16:44Z |
flavor | m1.tiny (1) |
hostId | 313f16dfa039b6343dadaa99f596545021ce67260dc5b91e2fe9bcc2 |
id | a55aeb82-303c-4bdc-92d2-280573a2ff8d |
image | cirros (c4d5f159-e1d9-4033-9e11-f9d1b63a777a) |
key_name | mykey |
name | provider-instance |
os-extended-volumes:volumes_attached | [] |
progress | 0 |
project_id | f2c087c678a446929110f5fe67b456ee |
properties | |
security_groups | [{u'name': u'default'}] |
status | ACTIVE |
updated | 2017-08-30T03:16:57Z |
user_id | cd4defe69232424e864726ebd078c010 |
neutron
列出当前租户所有的网络:neutron net-list、openstack network list
[root@controller openstack]# neutron net-list | ||
---|---|---|
id | name | subnets |
701a839d-6a57-42cc-8278-e7dcdb7af216 | provider | e820c8ae-d020-430b-9b26-46f046e647a7 192.168.1.0/24 |
列出所有租户的所有网络:neutron net-list --all-tenants
[root@controller openstack]# neutron net-list --all-tenants | ||
---|---|---|
id | name | subnets |
701a839d-6a57-42cc-8278-e7dcdb7af216 | provider | e820c8ae-d020-430b-9b26-46f046e647a7 192.168.1.0/24 |
创建一个网络:neutron net-create --shared(所有项目共享网络) --provider:physical_network(物理网络) public(物理网络的名称) --provider:network_type(创建的网络类型为flat,单一扁平网络)flat public-net(自定义一个名称) $ neutron net-create --shared --provider:physical_network provider --provider:network_type flat provider
Created a new network: | |
---|---|
Field | Value |
admin_state_up | True |
id | 0e62efcd-8cee-46c7-b163-d8df05c3c5ad |
mtu | 1500 |
name | provider |
port_security_enabled | True |
provider:network_type | flat |
provider:physical_network | provider |
provider:segmentation_id | |
router:external | False |
shared | True |
status | ACTIVE |
subnets | |
tenant_id | d84313397390425c8ed50b2f6e18d092 |
查看一个网络的详细信息:neutron net-show
[root@controller openstack]# neutron net-show provider | |
---|---|
Field | Value |
admin_state_up | True |
availability_zone_hints | |
availability_zones | nova |
created_at | 2017-08-23T08:46:56 |
description | |
id | 701a839d-6a57-42cc-8278-e7dcdb7af216 |
ipv4_address_scope | |
ipv6_address_scope | |
mtu | 1500 |
name | provider |
port_security_enabled | True |
router:external | False |
shared | True |
status | ACTIVE |
subnets | e820c8ae-d020-430b-9b26-46f046e647a7 |
tags | |
tenant_id | f2c087c678a446929110f5fe67b456ee |
updated_at | 2017-08-23T08:46:56 |
创建一个子网:neutron subnet-create --name (子网名)–allocation-pool start=开始地址 ,end=结束地址 --dns-nameserver DNS服务器 --gateway网关 网络名 子网IP [root@controller openstack]# neutron subnet-create --name provider-subnet --allocation-pool start=192.168.1.100,end=192.168.1.200 --dns-nameserver 223.5.5.5 --gateway 192.168.1.1 provider 192.168.1.0/24
Created a new subnet: | |
---|---|
Field | Value |
allocation_pools | {"start": "192.168.1.100", "end": "192.168.1.200"} |
cidr | 192.168.1.0/24 |
created_at | 2017-08-28T07:11:53 |
description | |
dns_nameservers | 223.5.5.5 |
enable_dhcp | True |
gateway_ip | 192.168.1.1 |
host_routes | |
id | 6360600b-9df0-4009-989d-ca1f17e17d6a |
ip_version | 4 |
ipv6_address_mode | |
ipv6_ra_mode | |
name | provider-subnet |
network_id | d687404b-4f96-46c1-9b7d-557cd5dcfd24 |
subnetpool_id | |
tenant_id | f2c087c678a446929110f5fe67b456ee |
updated_at | 2017-08-28T07:11:53 |
列出所有的agent 。neutron agent-list
[root@controller openstack]# neutron agent-list | ||||||
---|---|---|---|---|---|---|
id | agent_type | host | availability_zone | alive | admin_state_up | binary |
a6209814-6df3-4af2-9083-839947338347 | Linux bridge agent | controller | :-) | True | neutron-linuxbridge-agent | |
aa5068d0-8d37-45a7-a936-97bd7c6bf1cb | DHCP agent | controller | nova | :-) | True | neutron-dhcp-agent |
c34a7b5e-f04c-4e03-96f9-c47dd3465e21 | Metadata agent | controller | :-) | True | neutron-metadata-agent | |
d5e0b85c-138d-4d83-a3b0-cc4c7269171b | Linux bridge agent | compute1 | :-) | True | neutron-linuxbridge-agent |
cinder
查询
查看服务器服务 cinder-manage host list |sort [root@controller openstack]# cinder-manage host list|sort block1@lvm nova controller nova host zone