0% found this document useful (0 votes)
66 views15 pages

OpenStack Pike Volet 9

This document describes how to configure Cinder storage with multiple backends using LVM and NFS on OpenStack. Key steps include: 1. Configuring an LVM volume group and NFS share. 2. Configuring the storage, compute, and controller nodes to use the LVM and NFS backends. 3. Creating volume types (LVM, NFS) and volumes, then attaching the volumes to an instance.

Uploaded by

IRIE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views15 pages

OpenStack Pike Volet 9

This document describes how to configure Cinder storage with multiple backends using LVM and NFS on OpenStack. Key steps include: 1. Configuring an LVM volume group and NFS share. 2. Configuring the storage, compute, and controller nodes to use the LVM and NFS backends. 3. Creating volume types (LVM, NFS) and volumes, then attaching the volumes to an instance.

Uploaded by

IRIE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

OpenStack Pike

2017/09/03

Travaux de synthèse : Taylor VOLI

Volet 9
2

OpenStack Pike : Cinder Storage (Multi-BackEnds)


2017/09/06

It's possible to use Virtual Storages provided by Cinder if an Instance needs more disks.
Configure Virtual storage with LVM and NFS Multi-Backend on here.
------------+---------------------------+---------------------------+---
----------------------+------------
| | |
|
eth0|10.0.0.30 eth0|10.0.0.50
eth0|10.0.0.51 eth0|10.0.0.35
+-----------+-----------+ +-----------+-----------+ +-----------+---
--------+ +----------+-----------+
| [ Control Node ] | | [ Storage Node ] | | [ Compute
Node ] | | [ NFS Server ] |
| | | | |
| | |
| MariaDB RabbitMQ | | Open vSwitch | | Libvirt
| +----------------------+
| Memcached httpd | | L2 Agent | | Nova
Compute |
| Keystone Glance | | L3 Agent | | Open
vSwitch |
| Nova API | | Metadata Agent | | L2
Agent |
| Neutron Server | | Cinder-Volume | |
|
| Metadata Agent | | | |
|
| Cinder API | | | |
|
+-----------------------+ +-----------------------+ +---------------
--------+

[1] For LVM backend on this example, use a volume group [vg_volume01] for it.
NFS server is required to be running on your LAN, refer to here.
[2] On this example, configure [/var/lib/nfs-share] directory on [nfs.srv.world] as a shared
directory.
[3] Configure Storage Node.
[root@storage ~]#
yum -y install nfs-utils
[root@storage ~]#
vi /etc/idmapd.conf
# line 5: uncomment and change to the own domain name

Domain =
srv.world
[root@storage ~]#
vi /etc/cinder/cinder.conf

2
3

# add follows in the [DEFAULT] section

enabled_backends = lvm,nfs

# add follows to the end


[lvm]
iscsi_helper = lioadm
# volume group name
volume_group = vg_volume01
# IP address of Storage Node
iscsi_ip_address = 10.0.0.50
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volumes_dir = $state_path/volumes
iscsi_protocol = iscsi

[nfs]
volume_driver = cinder.volume.drivers.nfs.NfsDriver
volume_backend_name = NFS
nfs_shares_config = /etc/cinder/nfs_shares
nfs_mount_point_base = $state_path/mnt_nfs

[root@storage ~]#
vi /etc/cinder/nfs_shares
# create new : specify NFS shared directories

nfs.srv.world:/var/lib/nfs-share
[root@storage ~]#
chmod 640 /etc/cinder/nfs_shares

[root@storage ~]#
chgrp cinder /etc/cinder/nfs_shares

[root@storage ~]#
systemctl restart openstack-cinder-volume

[root@storage ~]#
chown -R cinder. /var/lib/cinder/mnt_nfs

[4] Configure Compute Node.


[root@node01 ~]#
yum -y install nfs-utils
[root@node01 ~]#
vi /etc/idmapd.conf
# line 5: uncomment and change to the own domain name

Domain =
srv.world
[root@node01 ~]#
vi /etc/nova/nova.conf

3
4

# add follows to the end

[cinder]
os_region_name = RegionOne
[root@node01 ~]#
systemctl restart openstack-nova-compute

[5] Create volume types. It's OK to work on any node. (This example is on Control Node)
# set environment variable first

[root@dlp ~(keystone)]#
echo "export OS_VOLUME_API_VERSION=2" >> ~/keystonerc

[root@dlp ~(keystone)]#
source ~/keystonerc
[root@dlp ~(keystone)]#
openstack volume type create lvm

+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| description | None |
| id | 5d149713-c14e-4eda-8e6c-2b8815a2d6e7 |
| is_public | True |
| name | lvm |
+-------------+--------------------------------------+

[root@dlp ~(keystone)]#
openstack volume type create nfs

+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| description | None |
| id | e441f2ee-58f3-4455-b398-282abaf86af0 |
| is_public | True |
| name | nfs |
+-------------+--------------------------------------+

[root@dlp ~(keystone)]#
openstack volume type list

+--------------------------------------+------+-----------+
| ID | Name | Is Public |
+--------------------------------------+------+-----------+
| e441f2ee-58f3-4455-b398-282abaf86af0 | nfs | True |
| 5d149713-c14e-4eda-8e6c-2b8815a2d6e7 | lvm | True |
+--------------------------------------+------+-----------+
[6] Create volumes with specifying volume types.

4
5

[root@dlp ~(keystone)]#
openstack volume create --type lvm --size 10 disk_lvm

+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2017-09-07T06:00:11.625138 |
| description | None |
| encrypted | False |
| id | 5a508399-fac9-4d42-b523-d9505e03c2ad |
| migration_status | None |
| multiattach | False |
| name | disk_lvm |
| properties | |
| replication_status | None |
| size | 10 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| type | lvm |
| updated_at | None |
| user_id | 09d8dfa20e0f40eaae448d369943b195 |
+---------------------+--------------------------------------+

[root@dlp ~(keystone)]#
openstack volume create --type nfs --size 10 disk_nfs

+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2017-09-07T06:00:31.474536 |
| description | None |
| encrypted | False |
| id | af3a5799-e301-4920-8a53-ab2d9b47054d |
| migration_status | None |
| multiattach | False |
| name | disk_nfs |
| properties | |
| replication_status | None |
| size | 10 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| type | nfs |
| updated_at | None |
| user_id | 09d8dfa20e0f40eaae448d369943b195 |

5
6

+---------------------+--------------------------------------+

[root@dlp ~(keystone)]#
openstack volume list

+--------------------------------------+----------+-----------+------+-------------+
| ID | Name | Status | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| af3a5799-e301-4920-8a53-ab2d9b47054d | disk_nfs | available | 10 | |
| 5a508399-fac9-4d42-b523-d9505e03c2ad | disk_lvm | available | 10 | |
+--------------------------------------+----------+-----------+------+-------------+
[7] Attache volume to an instance.
[root@dlp ~(keystone)]#
openstack server list

+-----------+----------+---------+------------------------------------+---------+---
-------+
| ID | Name | Status | Networks | Image |
Flavor |
+-----------+----------+---------+------------------------------------+---------+---
-------+
| 662f62b8- | CentOS_7 | SHUTOFF | int_net=192.168.100.12, 10.0.0.201 | CentOS7 |
m1.small |
+-----------+----------+---------+------------------------------------+---------+---
-------+

[root@dlp ~(keystone)]#
openstack server add volume CentOS_7 disk_lvm

[root@dlp ~(keystone)]#
openstack server add volume CentOS_7 disk_nfs
# the status of attached disk turns [in-use] like follows

[root@dlp ~(keystone)]#
openstack volume list

+--------------------------------------+----------+--------+------+-----------------
------------------+
| ID | Name | Status | Size | Attached to
|
+--------------------------------------+----------+--------+------+-----------------
------------------+
| af3a5799-e301-4920-8a53-ab2d9b47054d | disk_nfs | in-use | 10 | Attached to
CentOS_7 on /dev/vdc |
| 5a508399-fac9-4d42-b523-d9505e03c2ad | disk_lvm | in-use | 10 | Attached to
CentOS_7 on /dev/vdb |
+--------------------------------------+----------+--------+------+-----------------
------------------+

# detach the disk

6
7

[root@dlp ~(keystone)]#
openstack server remove volume CentOS_7 disk_lvm

[root@dlp ~(keystone)]#
openstack server remove volume CentOS_7 disk_nfs

7
8

OpenStack Pike : Configure Cinder Backup


2017/09/06

Configure Cinder Backup Service for Cinder block storages.


This example shows to configure NFS backend for backup storage.
For other backends, It's possible to confugire GlusterFS, Ceph, Object Storage(Swift), and
others.
------------+---------------------------+---------------------------+---
----------------------+------------
| | |
|
eth0|10.0.0.30 eth0|10.0.0.50
eth0|10.0.0.51 eth0|10.0.0.35
+-----------+-----------+ +-----------+-----------+ +-----------+---
--------+ +----------+-----------+
| [ Control Node ] | | [ Storage Node ] | | [ Compute
Node ] | | [ NFS Server ] |
| | | | |
| | |
| MariaDB RabbitMQ | | Open vSwitch | | Libvirt
| +----------------------+
| Memcached httpd | | L2 Agent | | Nova
Compute |
| Keystone Glance | | L3 Agent | | Open
vSwitch |
| Nova API | | Metadata Agent | | L2
Agent |
| Neutron Server | | Cinder-Volume | |
|
| Metadata Agent | | Cinder-Backup | |
|
| Cinder API | | | |
|
+-----------------------+ +-----------------------+ +---------------
--------+

NFS server is required to be running on your LAN, refer to here.


[1] On this example, configure [/var/lib/cinder-backup] directory on [nfs.srv.world] as a backup
directory.
[2] Configure Storage Node.
[root@storage ~]#
vi /etc/cinder/cinder.conf
# add follows into [DEFAULT] section

backup_driver = cinder.backup.drivers.nfs
backup_mount_point_base = $state_path/backup_nfs
backup_share = nfs.srv.world:/var/lib/cinder-backup
[root@storage ~]#
systemctl start openstack-cinder-backup

8
9

[root@storage ~]#
systemctl enable openstack-cinder-backup

[root@storage ~]#
chown -R cinder. /var/lib/cinder/backup_nfs

Get Backup for Cinder Volumes. It's OK to work on any node. (This example is on Control
[3]
Node)
[root@dlp ~(keystone)]#
openstack volume list

+--------------------------------------+--------+-----------+------+-------------+
| ID | Name | Status | Size | Attached to |
+--------------------------------------+--------+-----------+------+-------------+
| 19ca6fa7-202a-4a66-8fb7-05cb42305595 | disk01 | available | 10 | |
+--------------------------------------+--------+-----------+------+-------------+

# create a backup for [disk01] as the new name [backup-disk01]

[root@dlp ~(keystone)]#
openstack volume backup create --name backup-disk01 disk01

+-------+--------------------------------------+
| Field | Value |
+-------+--------------------------------------+
| id | 5f7abc45-1e72-43d4-8615-9ec642ccf8bc |
| name | backup-disk01 |
+-------+--------------------------------------+

# during cretation, [Status] is [creating]

[root@dlp ~(keystone)]#
openstack volume backup list

+--------------------------------------+---------------+-------------+----------+---
---+
| ID | Name | Description | Status |
Size |
+--------------------------------------+---------------+-------------+----------+---
---+
| 5f7abc45-1e72-43d4-8615-9ec642ccf8bc | backup-disk01 | None | creating |
10 |
+--------------------------------------+---------------+-------------+----------+---
---+

# after finishing creation, [Status] tunrs to [available]

[root@dlp ~(keystone)]#

9
10

openstack volume backup list

+--------------------------------------+---------------+-------------+-----------+--
----+
| ID | Name | Description | Status |
Size |
+--------------------------------------+---------------+-------------+-----------+--
----+
| 5f7abc45-1e72-43d4-8615-9ec642ccf8bc | backup-disk01 | None | available |
10 |
+--------------------------------------+---------------+-------------+-----------+--
----+
If there is a backup file of target storage you'd like to get backup, it's possible to get
incremental backup.
[4]
Furthermore, if target storage you'd like to get backup is now attaching on an Instance,
specify [--force] option to get backup forcely.
[root@dlp ~(keystone)]#
openstack volume backup list

+--------------------------------------+---------------+-------------+-----------+--
----+
| ID | Name | Description | Status |
Size |
+--------------------------------------+---------------+-------------+-----------+--
----+
| 5f7abc45-1e72-43d4-8615-9ec642ccf8bc | backup-disk01 | None | available |
10 |
+--------------------------------------+---------------+-------------+-----------+--
----+

[root@dlp ~(keystone)]#
openstack volume list

+--------------------------------------+--------+--------+------+-------------------
----------------+
| ID | Name | Status | Size | Attached to
|
+--------------------------------------+--------+--------+------+-------------------
----------------+
| 19ca6fa7-202a-4a66-8fb7-05cb42305595 | disk01 | in-use | 10 | Attached to
CentOS_7 on /dev/vdb |
+--------------------------------------+--------+--------+------+-------------------
----------------+

[root@dlp ~(keystone)]#
openstack volume backup create --name backup-disk01-01 --incremental --force disk01

+-------+--------------------------------------+
| Field | Value |
+-------+--------------------------------------+
| id | 92a629ef-c637-48cf-8b9c-8f58790927d9 |

10
11

| name | backup-disk01-01 |
+-------+--------------------------------------+

[root@dlp ~(keystone)]#
openstack volume backup list

+--------------------------------------+------------------+-------------+-----------
+------+
| ID | Name | Description | Status
| Size |
+--------------------------------------+------------------+-------------+-----------
+------+
| 92a629ef-c637-48cf-8b9c-8f58790927d9 | backup-disk01-01 | None | available
| 10 |
| 5f7abc45-1e72-43d4-8615-9ec642ccf8bc | backup-disk01 | None | available
| 10 |
+--------------------------------------+------------------+-------------+-----------
+------+
For restoring from Backups, run commands like follows.
[5]
For restoring, target volume must be detached from any instances.
[root@dlp ~(keystone)]#
openstack volume backup list

+--------------------------------------+------------------+-------------+-----------
+------+
| ID | Name | Description | Status
| Size |
+--------------------------------------+------------------+-------------+-----------
+------+
| 92a629ef-c637-48cf-8b9c-8f58790927d9 | backup-disk01-01 | None | available
| 10 |
| 5f7abc45-1e72-43d4-8615-9ec642ccf8bc | backup-disk01 | None | available
| 10 |
+--------------------------------------+------------------+-------------+-----------
+------+

[root@dlp ~(keystone)]#
openstack volume list

+--------------------------------------+--------+-----------+------+-------------+
| ID | Name | Status | Size | Attached to |
+--------------------------------------+--------+-----------+------+-------------+
| 19ca6fa7-202a-4a66-8fb7-05cb42305595 | disk01 | available | 10 | |
+--------------------------------------+--------+-----------+------+-------------+

# run restore

[root@dlp ~(keystone)]#
openstack volume backup restore backup-disk01-01 disk01

'VolumeBackupsRestore' object is not iterable

11
12

# during restore, status is [restoring-backup]

[root@dlp ~(keystone)]#
openstack volume list

+--------------------------------------+--------+------------------+------+---------
----+
| ID | Name | Status | Size | Attached
to |
+--------------------------------------+--------+------------------+------+---------
----+
| 19ca6fa7-202a-4a66-8fb7-05cb42305595 | disk01 | restoring-backup | 10 |
|
+--------------------------------------+--------+------------------+------+---------
----+

# after finishing restore, status turns to [available]

[root@dlp ~(keystone)]#
openstack volume list

+--------------------------------------+--------+-----------+------+-------------+
| ID | Name | Status | Size | Attached to |
+--------------------------------------+--------+-----------+------+-------------+
| 19ca6fa7-202a-4a66-8fb7-05cb42305595 | disk01 | available | 10 | |
+--------------------------------------+--------+-----------+------+-------------+

12
13

OpenStack Pike : Configure Swift#1 (Control Node)


2017/09/07

Configure OpenStack Object Storage (Swift).


This example is based on the emvironment like follows.
-+---------------+----------------------------+------------
| | |
| eth0|10.0.0.30 eth0|10.0.0.50
| +-----------+-----------+ +-----------+-----------+
| | [ Control Node ] | | [ Proxy Node ] |
| | | | |
| | MariaDB RabbitMQ | | Swift Proxy |
| | Memcached httpd | | |
| | Keystone | | |
| +-----------------------+ +-----------------------+
|
+---------------+----------------------------+-------------------------
---+---------
eth0|10.0.0.71 eth0|10.0.0.72
eth0|10.0.0.73
+-----------+-----------+ +-----------+-----------+ +--------
---+-----------+
| [ Storage Node#1 ] | | [ Storage Node#2 ] | | [
Storage Node#3 ] |
| | | | |
|
| Swift-Account | | Swift-Account | |
Swift-Account |
| Swift-Container | | Swift-Container | |
Swift-Container |
| Swift-Object | | Swift-Object | |
Swift-Object |
+-----------------------+ +-----------------------+ +--------
---------------+

[1] Add Swift user or service on Keystone Server (Control Node) first.
# add swift user

[root@dlp ~(keystone)]#
openstack user create --domain default --project service --password servicepassword swift

+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| default_project_id | c9ab6e9feb4d444c8f637fcfe7a67305 |
| domain_id | default |
| enabled | True |
| id | 1eb5408b29074f1b932faf6c64f06e0e |
| name | swift |
| options | {} |
| password_expires_at | None |

13
14

+---------------------+----------------------------------+

# add swift user in admin role

[root@dlp ~(keystone)]#
openstack role add --project service --user swift admin
# add an entry for swift service

[root@dlp ~(keystone)]#
openstack service create --name swift --description "OpenStack Object Storage" object-store

+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Object Storage |
| enabled | True |
| id | e5707b106ec64a49a752713e01edd505 |
| name | swift |
| type | object-store |
+-------------+----------------------------------+

# define the IP address of Proxy Node

[root@dlp ~(keystone)]#
export swift_proxy=10.0.0.50
# add an entry for swift endpoint (public)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne object-store public
http://$swift_proxy:8080/v1/AUTH_%\(tenant_id\)s

+--------------+---------------------------------------------+
| Field | Value |
+--------------+---------------------------------------------+
| enabled | True |
| id | 50420eb484d248b291a4f5cccfc2cb39 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | e5707b106ec64a49a752713e01edd505 |
| service_name | swift |
| service_type | object-store |
| url | http://10.0.0.50:8080/v1/AUTH_%(tenant_id)s |
+--------------+---------------------------------------------+

# add an entry for swift endpoint (internal)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne object-store internal
http://$swift_proxy:8080/v1/AUTH_%\(tenant_id\)s

14
15

+--------------+---------------------------------------------+
| Field | Value |
+--------------+---------------------------------------------+
| enabled | True |
| id | bb4d8a93ed624af48f829305b23be81d |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | e5707b106ec64a49a752713e01edd505 |
| service_name | swift |
| service_type | object-store |
| url | http://10.0.0.50:8080/v1/AUTH_%(tenant_id)s |
+--------------+---------------------------------------------+

# add an entry for swift endpoint (admin)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne object-store admin http://$swift_proxy:8080/v1

+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 3523f64dd1df459fb44f9f9deddd3b2b |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | e5707b106ec64a49a752713e01edd505 |
| service_name | swift |
| service_type | object-store |
| url | http://10.0.0.50:8080/v1 |
+--------------+----------------------------------+

15

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy