码迷,mamicode.com
首页 > 其他好文 > 详细

opensctack 02

时间:2018-03-12 11:08:53      阅读:233      评论:0      收藏:0      [点我收藏+]

标签:opensctack

运行openstack命令
1、初始化环境变量
[root@vh02 ~]# source keystonerc_admin
[root@vh02 ~(keystone_admin)]# openstack --help
2、创建项目
[root@vh02 ~(keystone_admin)]# openstack project create myproject
3、查看所有的项目
[root@vh02 ~(keystone_admin)]# openstack project list
4、查看项目详情
[root@vh02 ~(keystone_admin)]# openstack project show myproject
5、禁用激活项目
[root@vh02 ~(keystone_admin)]# openstack project set --disable myproject
[root@vh02 ~(keystone_admin)]# openstack project set --enable myproject
6、查看项目配额
[root@vh02 ~(keystone_admin)]# nova quota-show --tenant myproject
7、修改配额
[root@vh02 ~(keystone_admin)]# nova quota-update --cores 30 myproject
8、删除项目
[root@vh02 ~(keystone_admin)]# openstack project delete myproject

用户管理
1、创建用户
[root@vh02 ~(keystone_admin)]# openstack user create --password tedu.cn user2
2、设置用户
[root@vh02 ~(keystone_admin)]# openstack user set --email user2@tedu.cn user2
3、查看用户列表
[root@vh02 ~(keystone_admin)]# openstack user list
4、查看用户详情
[root@vh02 ~(keystone_admin)]# openstack user show user2
5、配置用户可以以_member_角色访问project1
[root@vh02 ~(keystone_admin)]# openstack role add --user user2 --project project1 member
6、查看user2在project1中的角色
[root@vh02 ~(keystone_admin)]# openstack role list --project project1 --user user2
7、禁用激活项目
[root@vh02 ~(keystone_admin)]# openstack user set --disable user2
[root@vh02 ~(keystone_admin)]# openstack user set --enable user2
8、修改密码
[root@vh02 ~(keystone_admin)]# openstack user set --password redhat user2
9、从project1中移除user2
[root@vh02 ~(keystone_admin)]# openstack role remove --project project1 --user user2 member
10、删除用户
[root@vh02 ~(keystone_admin)]# openstack user delete user2

创建云主机类型
1、创建名为demo.small的云主机类型
[root@vh02 ~(keystone_admin)]# openstack flavor create --public demo.small --id auto --ram 512 --disk 10 --vcpus 2
2、查看云主机类型列表
[root@vh02 ~(keystone_admin)]# openstack flavor list
3、删除云主机类型
[root@vh02 ~(keystone_admin)]# openstack flavor delete demo.small

镜像管理
1、创建镜像
[root@vh02 ~(keystone_admin)]# openstack image create --disk-format qcow2 --min-disk 10 --min-ram 512 --file /root/openstack/small.img minimal_rhel6
2、查看镜像
[root@vh02 ~(keystone_admin)]# openstack image list
[root@vh02 ~(keystone_admin)]# openstack image show minimal_rhel6
3、配置镜像
[root@vh02 ~(keystone_admin)]# openstack image set --public minimal_rhel6
4、删除镜像
[root@vh02 ~(keystone_admin)]# openstack image delete minimal_rhel6

查看openstack的状态
[root@vh02 ~(keystone_admin)]# openstack-status
无论是active,还是inactive都是正常的,如果出现failed则表示不正常
重启openstack服务
[root@vh02 ~(keystone_admin)]# openstack-service restart

增加额外的计算节点
1、准备vh03
vh03.tedu.cn 192.168.4.3/24 192.168.2.3/24 dns指向4.1 yum firewall selinux
2、拷贝rabbitmq公钥和相应的额外rpm包到vh03
3、关闭NetworkManager
[root@vh03 ~]# systemctl stop NetworkManager
[root@vh03 ~]# systemctl disable NetworkManager
4、导入rabbitmq公钥,安装额外rpm包
[root@vh03 openstack]# rpm --import rabbitmq-signing-key-public.asc
[root@vh03 openstack]# yum install -y rpms/*rpm
5、修改vh02的answer应答文件
[root@vh02 ~(keystone_admin)]# vim answer.txt
CONFIG_COMPUTE_HOSTS=192.168.4.2,192.168.4.3
6、在vh02上安装
[root@vh02 ~(keystone_admin)]# packstack --answer-file answer.txt

opensctack 02

标签:opensctack

原文地址:http://blog.51cto.com/13478354/2085361

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!