我们现在还差openstack的最后一个模块cinder模块,存储节点,那大家现在就有疑问了,虚拟机的存在哪里呢?
在结算节点上,即是:
[root@linux-node2 ~]# ll /var/lib/nova/instances/
总用量 16
drwxr-xr-x 2 root root 4096 8月 23 16:13 95e0d7eb-d3a8-4fe7-9b49-10fb36fb50b3
drwxr-xr-x 2 root root 4096 8月 22 18:40 _base
-rw-r--r-- 1 root root 49 8月 24 09:50 compute_nodes
drwxr-xr-x 2 root root 4096 8月 22 18:46 locks
[root@linux-node2 ~]# tree /var/lib/nova/instances/
/var/lib/nova/instances/
├── 95e0d7eb-d3a8-4fe7-9b49-10fb36fb50b3
│ ├── console.log
│ ├── disk
│ ├── disk.info
│ └── libvirt.xml ---->通过这个我们可以知道,它们是调用libvirt管理虚拟机的。
├── _base
│ └── 31f37fe39218043e4eff2d8f9015456059062495 --->这个就是传过来的镜像。
├── compute_nodes
└── locks
├── nova-31f37fe39218043e4eff2d8f9015456059062495
└── nova-storage-registry-lock
3 directories, 8 files
接下来,我们要在控制节点装cinder。
[root@linux-node1 ~]# cd /usr/local/src/cinder-2014.1
[root@linux-node1 cinder-2014.1]# python setup.py install
[root@linux-node1 cinder-2014.1]# mkdir /etc/cinder
[root@linux-node1 cinder-2014.1]# mkdir /var/log/cinder
[root@linux-node1 cinder-2014.1]# mkdir /var/lib/cinder
[root@linux-node1 cinder-2014.1]# mkdir /var/run/cinder
[root@linux-node1 cinder-2014.1]# cd etc/
[root@linux-node1 etc]# ls
cinder
[root@linux-node1 etc]# cd cinder/
[root@linux-node1 cinder]# ls
api-paste.ini cinder.conf.sample logging_sample.conf policy.json rootwrap.conf rootwrap.d
[root@linux-node1 cinder]# pwd
/usr/local/src/cinder-2014.1/etc/cinder
[root@linux-node1 cinder]# cp -r * /etc/cinder/
[root@linux-node1 cinder]# pwd
/usr/local/src/cinder-2014.1/etc/cinder
[root@linux-node1 cinder]# cd /etc/cinder/
[root@linux-node1 cinder]# ls
api-paste.ini cinder.conf.sample logging_sample.conf policy.json rootwrap.conf rootwrap.d
[root@linux-node1 cinder]# mv cinder.conf.sample cinder.conf
[root@linux-node1 cinder]# mv logging_sample.conf logging.conf
修改cinder配置文件
[root@linux-node1 cinder]# cd ~
[root@linux-node1 ~]# vim /etc/cinder/cinder.conf
connection = mysql://cinder:cinder@192.168.33.11/cinder
同步一下数据库
[root@linux-node1 ~]# cinder-manage db sync
查看一下成功与否
[root@linux-node1 ~]# mysql -ucinder -pcinder -e"use cinder;show tables;"
ERROR 1045 (28000): Access denied for user 'cinder'@'localhost' (using password: YES)
[root@linux-node1 ~]# mysql -h 192.168.33.11 -ucinder -pcinder -e"use cinder;show tables;"
+--------------------------+
| Tables_in_cinder |
+--------------------------+
| backups |
| encryption |
| iscsi_targets |
| migrate_version |
| quality_of_service_specs |
| quota_classes |
| quota_usages |
| quotas |
| reservations |
| services |
| snapshot_metadata |
| snapshots |
| transfers |
| volume_admin_metadata |
| volume_glance_metadata |
| volume_metadata |
| volume_type_extra_specs |
| volume_types |
| volumes |
+--------------------------+
# The RabbitMQ broker address where a single node is used.
# (string value)
rabbit_host=192.168.33.11
# The RabbitMQ broker port where a single node is used.
# (integer value)
rabbit_port=5672
# RabbitMQ HA cluster host:port pairs. (list value)
#rabbit_hosts=$rabbit_host:$rabbit_port
# Connect over SSL for RabbitMQ. (boolean value)
#rabbit_use_ssl=false
# The RabbitMQ userid. (string value)
rabbit_userid=guest
# The RabbitMQ password. (string value)
rabbit_password=guest
# The messaging driver to use, defaults to rabbit. Other
# drivers include qpid and zmq. (string value)
rpc_backend=rabbit
# The strategy to use for auth. Supports noauth, keystone, and
# deprecated. (string value)
auth_strategy=keystone
[keystone_authtoken]
#
# Options defined in keystoneclient.middleware.auth_token
#
# Prefix to prepend at the beginning of the path (string
# value)
#auth_admin_prefix=
# Host providing the admin Identity API endpoint (string
# value)
auth_host=192.168.33.11
# Port of the admin Identity API endpoint (integer value)
auth_port=35357
# Protocol of the admin Identity API endpoint(http or https)
# (string value)
auth_protocol=http
# Complete public Identity API endpoint (string value)
auth_uri=http://192.168.33.11:5000
# Keystone account username (string value)
admin_user=admin
# Keystone account password (string value)
admin_password=admin
# Keystone service account tenant name to validate user tokens
# (string value)
admin_tenant_name=admin
[root@linux-node1 ~]# grep "^[a-z]" /etc/cinder/cinder.conf
rabbit_host=192.168.33.11
rabbit_port=5672
rabbit_userid=guest
rabbit_password=guest
rpc_backend=rabbit
auth_strategy=keystone
connection = mysql://cinder:cinder@192.168.33.11/cinder
auth_host=192.168.33.11
auth_port=35357
auth_protocol=https
auth_uri=http://192.168.33.11:5000
admin_user=admin
admin_password=admin
admin_tenant_name=admin
[root@linux-node1 ~]# grep "^[a-z]" /etc/cinder/cinder.conf -c
14
# Print debugging output (set logging level to DEBUG instead
# of default WARNING level). (boolean value)
debug=true
# Print more verbose output (set logging level to INFO instead
# of default WARNING level). (boolean value)
verbose=true
# (Optional) Name of log file to output to. If no default is
# set, logging will go to stdout. (string value)
# Deprecated group/name - [DEFAULT]/logfile
log_file=cinder.log
# (Optional) The base directory used for relative --log-file
# paths (string value)
# Deprecated group/name - [DEFAULT]/logdir
log_dir=/var/log/cinder
[root@linux-node1 ~]# grep "^[a-z]" /etc/cinder/cinder.conf
rabbit_host=192.168.33.11
rabbit_port=5672
rabbit_userid=guest
rabbit_password=guest
rpc_backend=rabbit
auth_strategy=keystone
debug=true
verbose=true
log_file=cinder.log
log_dir=/var/log/cinder
connection = mysql://cinder:cinder@192.168.33.11/cinder
auth_host=192.168.33.11
auth_port=35357
auth_protocol=https
auth_uri=http://192.168.33.11:5000
admin_user=admin
admin_password=admin
admin_tenant_name=admin
[root@linux-node1 ~]# grep "^[a-z]" /etc/cinder/cinder.conf -c
18
[root@linux-node1 ~]# keystone service-create --name=cinder --type=volume --description="OpenStack Block Storage"
Expecting an auth URL via either --os-auth-url or env[OS_AUTH_URL]
[root@linux-node1 ~]# source keystone-admin
[root@linux-node1 ~]# keystone service-create --name=cinder --type=volume --description="OpenStack Block Storage"
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | 86c57c01cfa8434e9e70417b7da8b463 |
| name | cinder |
| type | volume |
+-------------+----------------------------------+
[root@linux-node1 ~]# keystone endpoint-create \
> --service-id=86c57c01cfa8434e9e70417b7da8b463 \
> --publicurl=http://192.168.33.11:8776/v1/%\(tenant_id\)s \
> --internalurl=http://192.168.33.11:8776/v1/%\(tenant_id\)s \
> --adminurl=http://192.168.33.11:8776/v1/%\(tenant_id\)s
+-------------+--------------------------------------------+
| Property | Value |
+-------------+--------------------------------------------+
| adminurl | http://192.168.33.11:8776/v1/%(tenant_id)s |
| id | a3b214ba716f4b49b83afc0117b789f0 |
| internalurl | http://192.168.33.11:8776/v1/%(tenant_id)s |
| publicurl | http://192.168.33.11:8776/v1/%(tenant_id)s |
| region | regionOne |
| service_id | 86c57c01cfa8434e9e70417b7da8b463 |
+-------------+--------------------------------------------+
命令直接复制即可:
[root@linux-node1 ~]# keystone endpoint-create --service-id=86c57c01cfa8434e9e70417b7da8b463 --publicurl=http://192.168.33.11:8776/v1/%\(tenant_id\)s --internalurl=http://192.168.33.11:8776/v1/%\(tenant_id\)s --adminurl=
http://192.168.33.11:8776/v1/%\(tenant_id\)s
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com