OpenStack 系列之File Share Service(Manila)

OpenStack  File Share Service(Manila) For Centos

Introduction:

Manila is the File Shareservice project for OpenStack. To administer the OpenStack File Share service,it is helpful to understand a number of concepts like share networks, shares,multi-tenancy and back ends that can be configured with Manila. Whenconfiguring the File Share service, it is required to declare at least one backend. Manila can be configured to run in a single-node configuration or acrossmultiple nodes. Manila can be configured to provision shares from one or moreback ends. The OpenStack File Share service allows you to offer file-shareservices to users of an OpenStack installation.

1.Create the database.

mysql -u root -p
CREATE DATABASE manila;
GRANT ALL PRIVILEGES ON manila.* TO ‘manila‘@‘localhost‘IDENTIFIED BY ‘password‘;
GRANT ALL PRIVILEGES ON manila.* TO ‘manila‘@‘%‘IDENTIFIED BY ‘password‘;

2.Create users, roles,service and API endpoint.

openstack user create --password-prompt manila
openstack role add --project service --user manila admin
openstack service create --name manila --description"OpenStack Shared Filesystems" share
openstack endpoint create   --publicurlhttp://10.4.15.150:8786/v1/%\(tenant_id\)s   --internalurlhttp://10.4.15.150:8786/v1/%\(tenant_id\)s   --adminurlhttp://10.4.15.150:8786/v1/%\(tenant_id\)s   --regionRegionOne   share

3.Install required packages on controller node.openstack-manila-api and openstack-manila-scheduler services will run on thecontroller node.

yum install openstack-manila python-manilapython-manilaclient

4.Installed required packages on compute node.openstack-manila-share service will run on the compute node.

yum install openstack-mania-share python-manila

5. Edit the /etc/manila/manila.conf file andapi-paste.ini

[DEFAULT]
osapi_share_listen=0.0.0.0
api_paste_config=/etc/manila/api-paste.ini
state_path=/var/lib/manila
glance_host=X.X.X.X
storage_availability_zone=nova
rootwrap_config=/etc/manila/rootwrap.conf
auth_strategy=keystone
enabled_share_backends=backend1
nova_catalog_info=compute:nova:publicURL
nova_catalog_admin_info=compute:nova:adminURL
nova_api_insecure=False
nova_admin_username=nova
nova_admin_password=password
nova_admin_tenant_name=service
nova_admin_auth_url=http://X.X.X.X:5000/v2.0
network_api_class=manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin
debug=True
verbose=True
log_dir=/var/log/manila
use_syslog=False
rpc_backend=rabbit
control_exchange=openstack
amqp_durable_queues=False
cinder_catalog_info=volume:cinder:publicURL
neutron_api_insecure=False
cinder_admin_username=cinder
neutron_auth_strategy=keystone
cinder_admin_password=password
notification_driver=messaging
neutron_admin_tenant_name=service
cinder_cross_az_attach=True
neutron_url=http://X.X.X.X:9696
cinder_api_insecure=False
cinder_admin_auth_url=http://X.X.X.X:5000/v2.0
cinder_http_retries=3
cinder_admin_tenant_name=service
neutron_admin_password=password
neutron_admin_username=neutron
neutron_admin_auth_url=http://X.X.X.X:5000/v2.0
neutron_url_timeout=30
default_share_type = default
sql_connection = mysql://manila:[email protected]/manila
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = password
[oslo_concurrency]
lock_path=/var/lock/manila
Warning!!!
This Manila Share Backend is configure on Manila Share node,So Manila-api and Manila-scheduler not configure.
[backend1]
service_network_division_mask=28
volume_name_template=manila-share-%s
service_instance_network_helper_type=neutron
max_time_to_build_instance=300
share_mount_path=/shares
manila_service_keypair_name=manila-service
service_network_name=manila_service_network
interface_driver=manila.network.linux.interface.OVSInterfaceDriver
service_network_cidr=10.254.0.0/16
service_instance_flavor_id=100
service_instance_smb_config_path=$share_mount_path/smb.conf
volume_snapshot_name_template=manila-snapshot-%s
share_backend_name=backend1
smb_template_config_path=$state_path/smb.conf
service_instance_name_template=manila_service_instance_%s
driver_handles_share_servers = True
service_instance_user = manila
service_instance_password=manila
service_image_name = manila-service-image
path_to_private_key = /root/.ssh/id_rsa
path_to_public_key = /root/.ssh/id_rsa.pub
share_backend_name = GENERIC1
share_driver = manila.share.drivers.generic.GenericShareDriver
share_helpers=CIFS=manila.share.drivers.generic.CIFSHelper,NFS=manila.share.drivers.generic.NFSHelper
share_volume_fstype=ext4
max_time_to_attach=120
service_instance_security_group=manila-service
connect_share_server_to_tenant_network=False
Replace /etc/manila/api-paste.ini,Configure Keystone authtoken.
service_protocol = http
service_host = X.X.X.X
service_port = 5000
auth_host = X.X.X.X
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = manila
admin_password = password
signing_dir = /var/lib/manila
auth_uri=http://X.X.X.X:5000/

6.Populate the Manila Database.

su -s /bin/sh -c "manila-manage db sync" manila

7.Start and enable manila services.

systemctl start openstack-manila-api
systemctl start openstack-manila-scheduler
systemctl enable openstack-manila-api
systemctl enable openstack-manila-scheduler
systemctl start openstack-manila-share
systemctl enable openstack-manila-share

8.Upload manila service imageto glance.

wget https://github.com/uglide/manila-image-elements/releases/download/0.1.0/manila-service-image.qcow2
glance image-create --name "manila-service-image-new" --file manila-service-image.qcow2 --disk-format qcow2 --container-format bare --visibility public --progress

9.Create default share type.

manila type-create default True

10. Create Manila flavor type.

nova flavor-create manila-service-flavor 100 128 0 1

11. Create nova for manila Security Group.

nova secgroup-create manila-service ‘manila-service description‘
nova secgroup-add-rule manila-service icmp -1 -1 0.0.0.0/0
nova secgroup-add-rule manila-service tcp 22 22 0.0.0.0/0
nova secgroup-add-rule manila-service tcp 2049 2049 0.0.0.0/0
nova secgroup-add-rule manila-service udp 2049 2049 0.0.0.0/0
nova secgroup-add-rule manila-service udp 445 445 0.0.0.0/0
nova secgroup-add-rule manila-service tcp 445 445 0.0.0.0/0
nova secgroup-add-rule manila-service tcp 137 139 0.0.0.0/0
nova secgroup-add-rule manila-service udp 137 139 0.0.0.0/0

12. Create share network.

manila share-network-create --name devinshare --neutron-net-id XXXXXXX --neutron-subnet-id XXXXXXX

13. Create NFS share.

manila create NFS 1 --name devin --share-network devinshare

14. Configure Manila access.

manila access-allow devin ip XXX(instance_ip) --access-level rw
时间: 2024-11-03 21:06:17

OpenStack 系列之File Share Service(Manila)的相关文章

OpenStack 系列之File Share Service(Manila)详解

首先说下什么是OpenStack? OpenStack是一个开源的云计算管理平台项目,由几个主要的组件组合起来完成具体工作.OpenStack支持几乎所有类型的云环境,项目目标是提供实施简单.可大规模扩展.丰富.标准统一的云计算管理平台.OpenStack通过各种互补的服务提供了基础设施即服务(IaaS)的解决方案,每个服 务提供API以进行集成.用Python语言编写. 什么是NAS服务? 众所周知,存储有几种类型的存储,DAS(Direct Attached Storage),NAS(Net

openstack安装配置—— file share node 配置

实际生产中,很多时候需要数据源的共享来实现多节点的实时数据保持一致,openstack官方提供了manila服务模块实现了云盘共享,manila服务也是需要manila服务端和存储节点共同组成的,本实验中为了节约虚机节点,就把manila服务端安装在了controller节点上,manila数据存储节点和cinder存储节点合并使用一个虚机节点,各自使用了一块独立硬盘. manila服务端配置 准备数据库 [[email protected] ~]# mysql Welcome to the M

Failed to enable unit: Refusing to operate on linked unit file mysql.service

在设置mysql开机启动时,出现了“Failed to enable unit: Refusing to operate on linked unit file mysql.service”,那么需要检测以下mysql是否设置过了开机启动, 方法为: sudo systemctl is-enabled mysql.service 如果已经设置过,会输出“enable” 可以先禁止mysql开机启动,控制台输入: sudo systemctl disable mysql.service 然后验证开

openstack系列文章(三)

学习openstack的系列文章-glance glance 基本概念 glance 架构 openstack CLI Troubleshooting 1. glance 基本概念 在 openstack 中提供 Image service 的是 Glance, 它让用户能够发现.获取和保存 Image. 其主要功能是: 通过提供 REST API 使得用户能够查询和获取 image 的元数据和 image 本身. 2. glance 架构 2.1 glance-api glance-api 是

Virtualbox mouse move in and out and file share with windows

How to use Virstalbox to share files with Linux and Windows, and to move the mouse in and out Virtualbox freely without click Ctrl key, herewith what I have done to achieve both. 1, download 'VBoxGuestAdditions_4.3.12.iso' 2, in RH Linux of Virtualbo

OpenStack镜像服务(Image service)的安装部署

OpenStack镜像服务(glance)允许用户发现.注册和恢复虚拟机镜像.Glance提供Rest API可以查询虚拟机镜像的metadata并且可以获取镜像.通过Glance,虚拟机镜像可以被存储到多种存储上,比如简单的文件存储或者对象存储(比如OpenStack中swift项目).一.OpenStack 镜像服务包含组件                                    图1.1. OpenStack glance组件  二.OpenStack 镜像服务安装    下

openstack系列文章(四)

学习 openstack 的系列文章 - Nova Nova 基本概念 Nova 架构 openstack Log Nova 组件介绍 Nova 操作介绍 1. Nova 基本概念 Nova 是 openstack 最核心的服务,负责管理和维护云环境的计算资源,虚拟机的生命周期管理就是通过 Nova 来实现的 . 2. Nova 架构 2.1 Nova 基本组件 如上图所示,Nova 由多个组件构成,这些组件以子服务的形式运行 . 举例,通过  systemctl status openstac

Openstack组件部署 — 将一个 New Service 添加到 Keystone

目录 目录 Keystone 认证流程 让 Keystone 为一个新的项目 Service 提供验证功能 最后 Keystone 认证流程 User 使用凭证(username/password) 到 keystone 验证并获得一个临时的 Token 和 Generic catalog(全局目录),临时的 Token 会存储在 keystone-client(cache UUID locally) 和 keystone-backend 中. User 使用这个临时 Token 发送给 key

IO系列之File

1 File类 1.1 目录列表器 在这里我主要是参考Think in Java的内容从而做的一些总结以及扩展.Java中的IO流的设计应该说是Java中最经典的,最学院式的设计,包括它的整体架构设计以及代码的构造. 现在让我们开始进行文件过滤吧.说到这里,说一下这个File类,从类名上看,它表示文件的意思,但是这个意思却不是准确的表达它的含义,FilePath应该来说更加的符合,它表示的就是文件的路径.好了,让我们看看当前的文件目录吧. 这个就是当前文件所在的目录. 好了,让我先列出所有的文件