• openstack(九)cinder


    mastesr:
    yum install openstack-cinder python-cinderclient

    /etc/cinder/cinder.conf 

    cat > /etc/cinder/cinder.conf <<EOF
    [DEFAULT]
    transport_url = rabbit://openstack:openstack@192.168.3.220
    auth_strategy = keystone
    [keystone_authtoken]
    auth_uri = http://192.168.3.220:5000
    auth_url = http://192.168.3.220:35357
    memcached_servers = 192.168.3.220:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project_name = service
    username = cinder
    password = cinder 
    [database]
    connection = mysql+pymysql://cinder:cinder@192.168.3.220/cinder
    [oslo_concurrency]
    lock_path = /var/lib/cinder/tmp
    EOF
    inder.conf

    初始化cinder数据库

    su -s /bin/sh -c "cinder-manage db sync" cinder && mysql -ucinder -pcinder -e "use cinder; show tables;"

    cat /etc/nova/nova.conf (增加)

    [cinder]
    os_region_name = RegionOne
    systemctl restart openstack-nova-api openstack-cinder-api openstack-cinder-scheduler
    systemctl enable openstack-cinder-api openstack-cinder-scheduler
    
     
    nova.conf

    创建服务与端点

    openstack service create --name cinder --description "Openstack Block Storage" volumev2
    openstack service create --name cinder --description "Openstack Block Storage" volumev3
    
    openstack endpoint create --region RegionOne volumev2 public http://192.168.3.220:8776/v2/%(tenant_id)s
    openstack endpoint create --region RegionOne volumev2 internal http://192.168.3.220:8776/v2/%(tenant_id)s
    openstack endpoint create --region RegionOne volumev2 admin http://192.168.3.220:8776/v2/%(tenant_id)s
    
    openstack endpoint create --region RegionOne volumev3 public http://192.168.3.220:8776/v3/%(tenant_id)s
    openstack endpoint create --region RegionOne volumev3 internal http://192.168.3.220:8776/v3/%(tenant_id)s
    openstack endpoint create --region RegionOne volumev3 admin http://192.168.3.220:8776/v3/%(tenant_id)s
    View Code

    ================================================================================================

    LVM节点(这里配置在控制器上)

    安装并设置卡机启动

    yum install -y lvm2 targetcli python-keystone openstack-cinder
    systemctl enable lvm2-lvmetad && systemctl start lvm2-lvmetad

    配置lvm卷

    fdisk -l
    pvcreate /dev/sdb
    vgcreate cinder-volumes /dev/sdb (查看vgdisplay cinder-volumes )
    配置lvm

    vim /etc/lvm/lvm.conf (中){    sed -i 's#^devices {#& filter = [ "a/sda/", "a/sdb/", "r/.*/"]#g'  /etc/lvm/lvm.conf             }
    devices { (系统又lvm才这样操作,排除掉系统本身的lvm,控制器上也需要配)
    ......
    filter = [ "a/sda/", "a/sdb/", "r/.*/"](存储节点,在控制器上需要配)
    }

    /etc/cinder/cinder.conf 增加

    [DEFAULT]
    verbose = True
    enabled_backends = lvm
    glance_host = http://192.168.3.220:9292
    
    [lvm]
    volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
    volume_group = cinder-volumes
    iscsi_protocol = iscsi
    iscsi_helper = lioadm
    
    [backend_defaults]
    iscsci_ip_address = 192.168.3.220
    nova.conf

    重启服务

    systemctl enable openstack-cinder-volume target && systemctl restart openstack-cinder-volume target

    控制器查看卷
    openstack volume service list

  • 相关阅读:
    跨域资源共享 CORS 详解以及IIS中的配置方法
    c#创建文件夹时无法访问路径,路径拒绝访问
    C#接口在派生类和外部类中的调用
    .NET/C#识别用户访问设备
    另一个SqlParameterCollection中已包含SqlParameter
    Java中throw和throws的区别
    MySQL与Oracle的语法区别详细对比
    hibernte中用criteria实现not in功能的方法
    使用Hibernate SQLQuery执行原生SQL
    hibernate查询数据表char类型字段只返回一个字符
  • 原文地址:https://www.cnblogs.com/Leaders543/p/12731838.html
Copyright © 2020-2023  润新知