openstack

openstack - cinder nfs로 구성

sysman 2021. 2. 2. 18:44
controller compute network
cinder-api  nova compute cinder-volume
cinder-scheduler l2 agent nfs client
nfs 서버 (20G) nfs client  

 

 

##################################

### controller 구성(nfs server) ###########

##################################

 

볼륨 설정 및 마운트

# lsblk

sdb           8:16   0   20G  0 disk

 

# mkfs.xfs /dev/sdb

 

#mkdir /share

#vi /etc/fstab

/dev/sdb                /share                  xfs     noatime,nodiratime,nobarrier,logbufs=8  0 2

 

#mount /share

#mount | grep share

 

#yum -y install nfs-utils nfs4-acl-tools*

# rpm -qa | grep nfs

 

#vi /etc/idmapd.conf

Domain = park.com

 

#vi /etc/exports

/share 192.168.100.0/24(rw,no_root_squash)

 

#systemctl start rpcbind nfs-server

#systemctl enable rpcbind nfs-server

#exportfs

/share          192.168.100.0/24

 

#############################################################

### network 노드에서 구성(storage 노드로 가상설정함 nfs client) ###########

##############################################################

 

#yum -y install nfs-utils

#vi /etc/idmapd.conf

Domain = park.com

 

#systemctl start rpcbind

#systemctl enable rpcbind

 

#vi /etc/cinder/cinder.conf

[DEFAULT]
my_ip = 192.168.100.112
log_dir = /var/log/cinder
state_path = /var/lib/cinder
enable_v1_api = True
enable_v2_api = True
enable_v3_api = True
auth_strategy = keystone
transport_url = rabbit://openstack:password@192.168.100.110
glance_api_servers = http://192.168.100.110:9292
enabled_backends = nfs

 

맨 아래쪽에 새로 작성

[nfs]

volume_driver = cinder.volume.drivers.nfs.NfsDriver

nfs_shares_config = /etc/cinder/nfs.conf

nfs_mount_point_base = $state_path/mnt

 

#vi /etc/cinder/nfs.conf

controller:/share

 

# showmount -e 192.168.100.110
Export list for 192.168.100.110:
/share 192.168.100.0/24

#chmod 640 /etc/cinder/nfs.conf

#chgrp cinder /etc/cinder/nfs.conf

#mkdir -p /var/lib/cinder/mnt

#systemctl restart openstack-cinder-volume

#chown -R cinder.cinder /var/lib/cinder/mnt

 

###############################################

### compute node에서 구성(storage nfs client) ###########

################################################

 

#yum install nfs-utils -y

#vi /etc/idmapd.conf

Domain = park.com

 

#systemctl start rpcbind

#systemctl enable rpcbind

 

#vi /etc/nova/nova.conf

[cinder]
os_region_name = RegionOne

 

#systemctl restart openstack-nova-compute

 

 

##################################

### controller node 설정(nfs server) ###########

##################################

disk 생성 후 VM 인스턴스에 할당

#echo "export OS_VOLUME_API_VERSION=2" >> ~/keystonerc

#source ~/keystonerc

#openstack volume create --size 1 disk1

#openstack volume list

#openstack server list

#openstack server add volume cirros disk1

 

제거

#openstack server remove volume cirros disk1

#openstack volume delete disk1