首先先使用“cinder delete”命令删除所有实例,释放磁盘空间。

停止cinder服务:
service openstack-cinder-api stop
service openstack-cinder-scheduler stop
service openstack-cinder-volume stop

备份配置文件:
cp -a /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak
cat /etc/cinder/cinder.conf.bak|grep -v '#'|grep -v '^$'>/etc/cinder/cinder.conf

修改配置文件:
[DEFAULT]
iscsi_ip_address=168.5.22.4
volume_backend_name=DEFAULT
iscsi_helper=tgtadm
volume_group=cinder
改为:
nfs_shares_config=/etc/cinder/nfs_shares
nfs_sparsed_volumes=true
nfs_mount_options=v3
volume_driver=cinder.volume.drivers.nfs.NfsDriver

创建挂载点配置文件:
echo '168.5.22.100:/volumes'>/etc/cinder/nfs_shares
chown root:cinder /etc/cinder/nfs_shares
chmod 0640 /etc/cinder/nfs_shares

查看cinder用户密码:
cat /etc/cinder/cinder.conf|grep connection
connection=mysql://cinder:eVUZuEyb@168.5.23.2/cinder?charset=utf8&read_timeout=60
密码是:eVUZuEyb

在任一节点重建数据库:
mysql -h 168.5.23.2 -u cinder -p -e 'drop database cinder;'
mysql -h 168.5.23.2 -u cinder -p -e 'create database cinder;'
su -s /bin/sh -c "cinder-manage db sync" cinder

启动cinder服务:
service openstack-cinder-volume start
service openstack-cinder-scheduler start
service openstack-cinder-api start

测试:
# source openrc
# nova list
+--------------------------------------+-----------------+--------+------------+-------------+---------------------+
| ID                                   | Name            | Status | Task State | Power State | Networks            |
+--------------------------------------+-----------------+--------+------------+-------------+---------------------+
| 312ba535-4279-4338-862e-4892a8393c65 | admin-instance1 | ACTIVE | -          | Running     | VLAN549=168.5.49.33 |
+--------------------------------------+-----------------+--------+------------+-------------+---------------------+
# cinder create --display-name admin-instance1-vol01 50
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
|      created_at     |      2016-01-13T01:29:36.916617      |
| display_description |                 None                 |
|     display_name    |        admin-instance1-vol01         |
|      encrypted      |                False                 |
|          id         | 3f84fef7-50bc-4794-9d24-07e13967cd6b |
|       metadata      |                  {}                  |
|         size        |                  50                  |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|     volume_type     |                 None                 |
+---------------------+--------------------------------------+
# cinder show 3f84fef7-50bc-4794-9d24-07e13967cd6b
+---------------------------------------+--------------------------------------+
|                Property               |                Value                 |
+---------------------------------------+--------------------------------------+
|              attachments              |                  []                  |
|           availability_zone           |                 nova                 |
|                bootable               |                false                 |
|               created_at              |      2016-01-13T01:29:37.000000      |
|          display_description          |                 None                 |
|              display_name             |        admin-instance1-vol01         |
|               encrypted               |                False                 |
|                   id                  | 3f84fef7-50bc-4794-9d24-07e13967cd6b |
|                metadata               |                  {}                  |
|         os-vol-host-attr:host         |    node-1.evecom.net#Generic_NFS     |
|     os-vol-mig-status-attr:migstat    |                 None                 |
|     os-vol-mig-status-attr:name_id    |                 None                 |
|      os-vol-tenant-attr:tenant_id     |   df54866bc83f4f5f96fae17b3810a343   |
|   os-volume-replication:driver_data   |                 None                 |
| os-volume-replication:extended_status |                 None                 |
|                  size                 |                  50                  |
|              snapshot_id              |                 None                 |
|              source_volid             |                 None                 |
|                 status                |              available               |
|              volume_type              |                 None                 |
+---------------------------------------+--------------------------------------+
# nova volume-attach admin-instance1 3f84fef7-50bc-4794-9d24-07e13967cd6b
+----------+--------------------------------------+
| Property | Value                                |
+----------+--------------------------------------+
| device   | /dev/vdb                             |
| id       | 3f84fef7-50bc-4794-9d24-07e13967cd6b |
| serverId | 312ba535-4279-4338-862e-4892a8393c65 |
| volumeId | 3f84fef7-50bc-4794-9d24-07e13967cd6b |
+----------+--------------------------------------+

配置cinder使用NFS后端的更多相关文章

  1. 在kolla中配置cinder ceph多后端

    原文链接:在kolla中配置cinder ceph多后端

  2. 配置glance使用NFS后端

    首先先使用“glance image-delete”命令删除所有镜像,释放磁盘空间. 停止glance服务:service openstack-glance-api stopservice opens ...

  3. cinder块存储 后端采用lvm、nfs安装配置

    #cinder块存储 后端采用lvm.nfs安装配置 openstack pike 安装 目录汇总 http://www.cnblogs.com/elvi/p/7613861.html #cinder ...

  4. cinder存储节点 后端采用lvm、nfs安装配置

    #cinder存储节点 openstack pike 部署 目录汇总 http://www.cnblogs.com/elvi/p/7613861.html #cinder存储节点 #cinder后端采 ...

  5. cinder支持nfs快照

    [问题描述] cinder后端设置为NFS,磁盘创建快照失败. 日志里面发现了这个错误: VolumeDriverException: Volume driver reported an error: ...

  6. ubuntu 配置TFTP和NFS

    1.安装软件包 sudo apt-get install tftpd tftp xinetd 2.建立配置文件 在/etc/xinetd.d/下建立一个配置文件tftp sudo vi /etc/xi ...

  7. Cluster基础(一):配置iSCSI服务、编写udev规则、配置并访问NFS共享、部署Multipath多路径环境

    一.配置iSCSI服务 目标: 本案例要求先搭建好一台iSCSI服务器,并将整个磁盘共享给客户端: 虚拟机添加新的磁盘 将新添加的磁盘分区并创建两个逻辑卷 逻辑卷名称分别为:/dev/myvg/isc ...

  8. 配置samba和NFS共享服务

                            配置samba和NFS共享服务 1案例1:配置SMB文件夹共享 1.1问题 本例要求在虚拟机server0上发布两个共享文件夹,具体要求如下: 此服务器 ...

  9. kolla-ansible配置cinder 的ceph的多种后端存储池【转】

    在实际的使用中,openstack后端采用ceph存储,存储磁盘类型有SATA和SSD,这里如果想基于存储驱动器提供多种云硬盘类型,可以基于下面的配置完成 点击查看配置详情

随机推荐

  1. hdu_5748_Bellovin(LIS)

    题目链接:hdu_5748_Bellovin 题意: 给你一个数列ai,设f(a1,a2,a3,..an)=(f1,f2,f3,...,fn),其中fi表示以ai结尾的最长递增子序列长度,注意:必须要 ...

  2. ice使用过程遇到的问题

    1 设置代理超时时间ice_timeout ICE的每个连接都有两个超时时间:ice_timeout.ice_connectiontimeout,分别对应消息的超时时间和连接建立    的超时时间,可 ...

  3. find the closest sum to a target value

    problem: given an array of integers including positive and negative, a target value. find 2 numbers ...

  4. 在Mac下显示所有文件

    显示所有隐藏文件: 第一个命令:defaults write com.apple.finder AppleShowAllFiles TRUE 回车后,迫使系统将用户资源库里Preferences文件夹 ...

  5. The project target (Android 6.0) was not properly loaded或者The rendering target (Android 6.0) is still loading.

    第一步:在project上右键选择Properties,然后选择Android, 然后在Project Build Target那里选择其他的Target试试: 第二步: 我选了6.0之后,就有菜单可 ...

  6. Hibernate Tools

    (声明)本文转自:http://linjia880714.iteye.com/blog/859334 hibernate-tools详细使用教程 使用hibernate-tool的版本是hiberna ...

  7. Python 协程/异步IO/Select\Poll\Epoll异步IO与事件驱动

    1 Gevent 协程 协程,又称微线程,纤程.英文名Coroutine.一句话说明什么是线程:协程是一种用户态的轻量级线程. 协程拥有自己的寄存器上下文和栈.协程调度切换时,将寄存器上下文和栈保存到 ...

  8. hibernate ——helloWorld程序(XML配置)

    1.项目结构 2.hibernate实现了Java类 和 数据库表的映射(Map) 先看一下Student的Java类和对应的数据库表 package com.pt.hibernate; public ...

  9. # 泰语字符串字符分割 --- UTF-8编码格式

    1.泰语编码格式 泰语用的编码格式是:ISO 8859-11,这个是Latin编码系列,是从"ISO-8859-1"发展过来的,采用的是8bit一个字,所以泰语中的英文字母或者数字 ...

  10. BigDecimal加减乘除运算

    java.math.BigDecimal.BigDecimal一共有4个够造方法,让我先来看看其中的两种用法: 第一种:BigDecimal(double val)Translates a doubl ...