zoukankan      html  css  js  c++  java
  • 配置cinder使用NFS后端


    首先先使用“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 |
    +----------+--------------------------------------+

  • 相关阅读:
    Key ssd_300_vgg/block3_box/L2Normalization/gamma not found in checkpoint的解决方案
    微调(Fine-tune)原理
    TensorFlow的数据读取机制
    卷积神经网络CNN识别MNIST数据集
    TensorFlow基本计算单元与基本操作
    一些小软件闪退的解决方案
    机器学习之SVM调参实例
    机器学习之支持向量机算法(二)
    机器学习之支持向量机算法(一)
    机器学习项目实战----新闻分类任务(二)
  • 原文地址:https://www.cnblogs.com/endoresu/p/5126489.html
Copyright © 2011-2022 走看看