Install & konfigurasi Openstack Newton Multinode di Ubuntu 16.04 – Part 13 (Cinder – Block Storage)

Pada part 13 ini saya akan membahas tentang installasi dan konfigurasi pada storage node / block storage node.

okee sebelumnya kita harus menambahkan hardisk dengan kapasitas 100 GB untuk diadikan sebagai block storage nantinya.

sebagai contoh nanti kita akan mengunakan /dev/sdb

Jalankan perintah ini pada storage node

[STORAGE NODE]

sebelum kita menginstall dan konfigurasi layanan block storage service pada storage node maka kita harus mempersiapkan storage devicenya terlebih dahulu.

  • Install LVM 2
root@cinder:~# apt install lvm2

setelah itu sebelum kita mengkonfigurasi block storage kita harus membuat partisi dahulu pada hardisk yang baru, supaya memiliki partisi LVM

*saya merekomendasikan anda untuk mengunakan 2 hardisk karena cinder pada newton mengunakan heartbeat sehingga akan mengecek hardisk yang lainnya untuk high availability, misalkan sdb dan sdc, namun pada saat penambahan hardisk utnuk partisi lvm sebaiknya mematikan service cinder-volume dan tgt.

root@cinder:~# fdisk -l

Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9888700b

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048 102762495 102760448   49G 83 Linux
/dev/sda2       102764542 104855551   2091010 1021M  5 Extended
/dev/sda5       102764544 104855551   2091008 1021M 82 Linux swap / Solaris


Disk /dev/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

disitu ada /dev/sdb dengan kapasistas 100 GB namun belum terdapat partisi.

root@cinder:~# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x54865d53.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-209715199, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-209715199, default 209715199): 

Created a new partition 1 of type 'Linux' and of size 100 GiB.

Command (m for help): t
Selected partition 1
Partition type (type L to list all types): L 

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris        
 1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden or  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx         
 5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data    
 6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility   
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt         
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access     
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O        
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor      
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi ea  Rufus alignment
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         eb  BeOS fs        
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ee  GPT            
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        ef  EFI (FAT-12/16/
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f0  Linux/PA-RISC b
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f1  SpeedStor      
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f4  SpeedStor      
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      f2  DOS secondary  
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fb  VMware VMFS    
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fc  VMware VMKCORE 
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fd  Linux raid auto
1c  Hidden W95 FAT3 75  PC/IX           bc  Acronis FAT32 L fe  LANstep        
1e  Hidden W95 FAT1 80  Old Minix       be  Solaris boot    ff  BBT            
Partition type (type L to list all types): 8e
Changed type of partition 'Linux' to 'Linux LVM'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

*keterangan untuk membuat partisi

  • pilih n untuk membuat partisi baru
  • ketik p untuk memilih primary
  • ketik 1 untuk membuat partisi no 1
  • tekan enter 2 kali untuk membuat sektor first sector dan last sector
  • ketik t untuk memilih type partisi
  • ketik 8e untuk type partisi Linux LVM
  • ketik w utnuk menyimpan partisi
  • kemudian kita check hasil partisi yang sudah kita buat
root@cinder:~# fdisk -l

Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9888700b

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048 102762495 102760448   49G 83 Linux
/dev/sda2       102764542 104855551   2091010 1021M  5 Extended
/dev/sda5       102764544 104855551   2091008 1021M 82 Linux swap / Solaris


Disk /dev/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x54865d53

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1        2048 209715199 209713152  100G 8e Linux LVM
  • Kemudian kita membuat volume fisik LVM /dev/sdb
root@cinder:~# pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created

kita mengunakan partisi yang sudah kita buat yaitu sdb1

  • setelah itu membuat volume group LVM
root@cinder:~# vgcreate cinder-volume /dev/sdb1
  Volume group "cinder-volume" successfully created

pada service block storage ini akan menciptakan volume secara logis pada volume group

Hanya instance yang dapat mengakases block storage. secara default volume LVM akan memindai seluruh disk yang mengunakan lvm volume. dengan adanya masalah itu maka kita harus membuat semacam filtering , hanya pada disk tertentu saja yang akan di scan

edit file /etc/lvm/lvm.conf

  • tambahkan filter pada bagian devices
devices {
...
filter = [ "a/sdb1/", "r/.*/"]

namun jika sistem operasi kita pada storage node juga mengunakan partisi LVM maka kita harus memberikan filtering juga pada partisi sda

devices {
.......
filter = [ "a/sda/", "a/sdb1/", "r/.*/"]

tapi secara default kita hanya memfilter sdb1 saja.

  • Install cinder volume
root@cinder:~# apt install cinder-volume

edit file /etc/cinder/cinder.conf

  • mengatur akses database pada bagian [database]
[database]
...
connection = mysql+pymysql://cinder:password_cinder@controller/cinder
  • konfigurasi message queue RabbitMQ pada [DEFAULT]
[DEFAULT]
...
transport_url = rabbit://openstack:password_rabbit@controller
  • konfigurasi akses identity service pada bagian [DEFAULT] dan [keystone_authtoken]
[DEFAULT]
...
auth_strategy = keystone

[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = password_cinder
  • konfigurasi my_ip mengunakan ip management dari storage node pada bagian [DEFAULT]
[DEFAULT]
...
my_ip = 10.0.0.30 #ip management storage node
  • konfigurasi LVM backend dengan LVM driver, volume group, iscsi protocol untuk memberikan layanan yang tepat pada iscsi pada bagian [lvm]
[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = tgtadm

  • Mengaktifkan LVM backend pada [DEFAULT]
[DEFAULT]
.....
enabled_backends = lvm
  • konfigurasi lokasi dari API   image service pada [DEFAULT]
[DEFAULT]
....
glance_api_servers = http://controller:9292
  • konfigurasi lock path pada [oslo_concurrency]
[DEFAULT]
.....
lock_path = /var/lib/cinder/tmp

okee, setelah semua dikonfigruasi maka kita harus mereload servicenya

  • restart block storage volume service
root@cinder:~# /etc/init.d/tgt restart
[ ok ] Restarting tgt (via systemctl): tgt.service.
root@cinder:~# /etc/init.d/cinder-volume restart
[ ok ] Restarting cinder-volume (via systemctl): cinder-volume.service.

okee cukup sekian dulu proses installasi openstack part13, nanti kita akan lanjutkan pada part14 untuk verfikasi operation block storage pada controller node

wassalam

About the author
Alan Adi Prastyo

Routecloud Networks

Information about Server, Linux and Computer Network.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Routecloud Networks.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.