openstack 组件命令
Glance组件操作(镜像服务组件)
#环境配置:
source /etc/keystone/admin-openrc.sh
#查看镜像列表:
glance image-list openstack image list
#查看镜像详情:
glance image-show 镜像ID openstack image show centos7
#上传:
cd /opt/iaas/images/glance image-create --name "centos7.2" --disk-format qcow2 --container-format bare --progress < CentOS_7.2_x86_64_XD.qcow2
#更新:
glance image-update --min-disk 1 镜像ID
#导出:
glance image-download --file /opt/centos72.qcow2 --progress 镜像ID
cd /opt/
du -sh *
#删除:
glance image-delete 镜像ID
Keystone运维命令
#环境配置:
source /etc/keystone/admin-openrc.sh
#创建用户:
openstack user create --password ps1234 --email zzz@example.com --domain demo zzz
#创建acme项目:
openstack project create --domain demo acme
#创建角色:
openstack role create compute-user
#绑定用户和项目权限
#添加的用户需要分配一定的权限,需要把用户关联绑定到对应的项目和角色:
openstack role add --user hqs --project acme compute-user
#用户列表查询:
openstack user list
#查询zzz用户详细信息:
openstack user show zzz
#查询当前openstack平台所有项目:
openstack project list
#查询acme项目详情:
openstack project show acme
#查询所有keystone角色:
openstack role list
Nova组建操作(计算服务组件)
#安全组查看:
nova secgroup-list
#安全组创建:
nova secgroup-create zzz 'Most great security group'
#安全组删除:
nova secgroup-delete zzz
#安全组规则查看:
nova secgroup-list-rules zzz
nova secgroup-list-rules default
#安全组规则添加:
nova secgroup-add-rule hqs icmp -1 -1 0.0.0.0/0
nova secgroup-add-rule hqs udp 1 65535 0.0.0.0/0
nova secgroup-add-rule hqs tcp 1 65535 0.0.0.0/0
#安全组规则删除:
nova secgroup-delete-rule zzz icmp -1 -1 0.0.0.0/0
nova secgroup-list-rules zzz #查看规则
Horizon(自动化图形界面)
暂无
Neutorn(网络服务组件)
网络
#查看网络列表:
neutron net-list
#创建外部网络:
neutron net-create --shared --router:external=true --provider:network_type gre net-test-gre
#创建内部网络:
neutron net-create --shared --provider:network_type gre int-test-gre
#查看网络详情:
neutron net-show int-test-gre
#删除网络:
neutron net-delete int-test-gre
#更新网络:
openstack network set net-test-gre --name net-test11-gre --disable --no-share
neutron net-show net-test11-gre
子网
#创建外网子网:
neutron subnet-create net-gre 192.168.20.0/24 --name net-subnet01 --gateway 192.168.20.2 --allocation-pool start=192.168.20.101,end=192.168.20.240 --enable-dhcp --dns-nameserver 8.8.8.8
#创建内网子网:
neutron subnet-create int-gre 10.10.1.0/24 --name int-subnet01 --gateway 10.10.1.2 --allocation-pool start=10.10.1.101,end=10.10.1.240 --enable-dhcp
#查看子网列表信息:
neutron subnet-list
#查看子网详细信息:
neutron subnet-show net-subnet01
#删除子网:
neutron subnet-delete int-subnet01
路由
#创建路由:
neutron router-create router
#查看路由列表:
neutron router-list
#查看路由详情:
neutron router-show router
#删除路由:
neutron router-delete router
#添加外部网关:
neutron router-gateway-set router01 net-gre
neutron router-port-list router01
#删除外部网关:
neutron router-gateway-clear router01
neutron router-port-list router01
#添加内部接口:
neutron router-interface-add router01 int-subnet
neutron router-port-list router01
#删除内部接口:
neutron router-interface-delete router01 subnet=int-subnet
neutron router-port-list router01
#查看路由端口信息列表:
neutron router-port-list router01
端口
#查看端口列表:
neutron port-list
#查看端口详情:
neutron port-show 1b46a0d6-0df6-4f96-b3a3-d47aae6ed589
#创建端口:
neutron port-create int-gre --name test-port
#删除端口:
neutron port-delete test-port
#修改端口:
neutron port-update test-port --name test-port-8080 --security-group 54c9ccb7-7f00-4485-898f-e4bbebafa73b
Cinder(块存储服务模块)
#卷列表查看:
cinder list
#卷详情查看:
cinder show test2(查看的name)
#卷创建(size只能是整数):
cinder create --name test --description 'new volume' --availability-zone nova 2
#卷删除:
cinder delete test
#扩容:
cinder extend test-volume-01 5
cinder list
#查看类型:
cinder type-list
#删除类型:
cinder type-delete lvm
heat(编排服务)
暂无
Ceilometer(监控服务组件)
暂无
Swift (对象存储服务)