Friday, May 22, 2020

Understanding Stratis in RHEL8

                          ဒီarticle ကတော့  RHEL8 ရဲ့ new features အကြောင်းတွေ online မှာကြည့်နေရင်းနဲ့ "stratis" ဆိုတဲ့ local storage management tool တစ်ခု ကို လေ့လာကြည့်မိပါတယ်။ အဲ့ feature က ကျွန်တော်တို့ linux system တစ်ခုရဲ့ storage devices တွေ ကို ဘယ်လိုမျိုး manage လုပ်ပြီး အသုံးပြုလို့ရလဲ ဒီ "stratis" က ကျွန်တော်တို့ ပုံမှန် block devices တွေကို manage လုပ်ပြီးသုံးတာထက် ဘယ်လိုမျိုး ကွဲပြားစွာ အသုံးပြုနိုင်လဲဆိုတာလေး ပြောပြသွားမှာဖြစ်ပါတယ်။

So, What is Stratis?

                      Stratis က "Volume Management System" တစ်ခုဖြစ်ပါတယ်။ သူ က ကျွန်တော်တို့ system တစ်ခုမှာရှိတဲ့ underlying block devices တွေကို ပေါင်းစည်းပြီး storage pool တစ်ခု အနေနဲ့ တည်ဆောက်အသုံးပြုလို့ ရနိုင်တာဖြစ်ပါတယ်။ အဲ့လိုပြောလို့ ကျွန်တော်တို့ ရဲ့ "LVM" နဲ့ တူမလားဆိုပြီး ထင်ကောင်းထင်နိုင်ပါတယ်။ "LVM" ကိုကျတော့ သူ့ကို "standalone volume manager" လို့ သတ်မှတ်ပါတယ်။ Design ပိုင်းအရ မတူညီပဲ တူညီတာ တစ်ခု ကတော့ သူ့တို့ နှစ်ခုစလုံးက ဒီ physical block devices တွေကို linux kernel ပေါ်မှာ virtual storage pool တွေ အနေနဲ့ သိနိုင် အောင်လုပ်ပေးတဲ့ "device-mapper" framework ကိုတော့ အသုံးပြုထားတာဖြစ်ပါတယ်။ 



                      အဲ့တော့ သူ့ ရဲ့ design က တစ်ကယ်တမ်း ဘယ်ကနေ inspiration ယူပြီး ဆင်းသက်လာလဲဆိုတော့ ကျွန်တော်တို့ "stratis" မတိုင်ခင် ရှိနေနှင့်ပြီးသားဖြစ်တဲ့ "ZFS" , "btrfs" တို့ကနေ ဆင်းသက်လာတာဖြစ်ပါတယ်။ ချွင်းချက်အနေနဲ့ ဒီ RHEL8 မှာ "zfs" နဲ့ "btrfs" တို့ကို red hat ကနေ support မပေးတော့ပါဘူး။
                     အမှန်တိုင်းပြောရင် ကျွန်တော် "zfs" , "btrfs" တို့နဲ့ မရင်းနှီးဘူး "zpool status" ဘာညာတော့ နည်းနည်းပါးပါး solaris project မှာပါတုန်းက ရိုက်ဖူးတယ်ပေါ့ဗျာ :D  ဒါပေမယ့် သူတို့ရဲ့သဘောတရားက ကျွန်တော် တို့ block devices တစ်ခု ကို ပုံမှန် အသုံးပြုဖို့အတွက် ပြင်ဆင်ရရင် အရင်ဆုံး partition ဖွဲ့ရတယ် ဖွဲ့ရာမှာလဲ fdisk တို့ parted တို့ ကိုအသုံးပြုပြီး ဖွဲ့ရတယ်ပေါ့ နောက်ပြီးတော့မှ OS မှာ အသုံးပြုနိုင်ဖို့အတွက် filesystem တစ်ခုခုကို (i.e ext4, xfs, etc..) စသည်ဖြင့် အသုံးပြုရတယ်ပေါ့။
                      အခု ဒီ "stratis" တို့ "zfs/btrfs" တို့မှာကျတော့ သူတို့ရဲ့ အလုပ်လုပ်ပုံက အပေါ်က လုပ်ရတဲ့ volume တည်ဆာက်ရတာတွေ file system သတ်မှတ် ရတာတွေကို တစ်ခုချင်းစီ တစ်ခုချင်းစီ မလုပ်တော့ပဲ တစ်ခါထဲပေါင်းစည်းပြီး တည်ဆောက်လိုက်တာဖြစ်ပါတယ်။ တစ်နည်းအားဖြင့် stratis နဲ့ storage pool တစ်ခုတည်ဆောက်တော့မယ်ဆိုရင် partition တစ်ခု ပိုင်းဖို့အတွက် fdisk တို့ filesystem တစ်ခု တည်ဆောက်ဖို့အတွက် mkfs တို့ စသည်တို့ကို အသုံးပြုစရာမလိုပဲ တစ်ခါထဲ storage pool တည်ဆောက် filesystem ပါ တစ်ခါထဲတည်ဆောက်ပြီး အသုံးပြုလို့ရနိုင်တာဖြစ်ပါတယ်။ ဒီလိုမျိုး file system + volume တစ်ပေါင်းတစ်စည်းထဲ လုပ်ပေးတာတွေကို VMFs (Volume Management Filesystem) ဟုခေါ်ပါတယ်။ အဲ့တော့ filesystem နဲ့ volume management ပေါင်းလိုက်တော့ သူ့မှာ file system မလိုအပ်တော့ဘူးလားဆိုတော့ မဟုတ်ပါဘူး လိုအပ်ပါတယ် filesystem ကို သပ်သပ် ထပ်ပြီး ပေးစရာမလိုပဲ volume နဲ့အတူ တည်ဆောက်ပြီးသားဖြစ်သွားတာပါ။  လက်ရှိမှာတော့ XFS filesystem က stratis ရဲ့ default filesystem ဖြစ်ပါတယ်။ နောက်ပိုင်းမှာတော့ multiple filesystem အမျိုးအစားတွေကိုပါ အသုံးပြုလို့ရသွားမယ်လို့ဆိုပါတယ်။ 
                     ဒီနေရာမှာ ကျွန်တော်တို့ တစ်ခု ကွဲပြားစေချင်တာ "stratis" တို့မှာ  ကျွန်တော့်တို့ ဒီ XFS file sytem သုံးတယ်ဆိုပေမယ့် user က define လုပ်သွားတာမဟုတ်ပဲ "stratis" ကပဲ user အစား ပြုလုပ်သွားတာဖြစ်ပါတယ်။ နောက်ပြီး storage volume maintenance တွေ sizing manage ပိုင်းတွေကို သာမန်လို user က manage လုပ်ပေးစရာမလိုတော့ပဲ stratis ကနေ အားလုံးကို  handle လုပ်ပေးသွားတာဖြစ်ပါတယ်။ ဒါဟာလဲ အဓိက အချက်အနေနဲ့ LVM နဲ့ မတူညီတဲ့ approach ဖြစ်ပါတယ်။ 

A little bit detail about "Stratis" layers
                 
                    ပြောမယ့်ပြောတော့တစ်ခါထဲ နောက်မေ့သွားရင်ပြန်ကြည့်လို့ရအောင် stratis ရဲ့ တည်ဆောက်ပုံ design လေး အနည်းငယ် ပြောပြချင်ပါတယ်။ ဆိုတော့  Stratis  တည်ဆောက်ပုံမှာ "backstore subsystem" layer နဲ့ "thinpool subsystem" layer ဆိုပြီး နှစ်ခု ပါ၀င်ပါတယ်။ ဒီ layer တွေက backend ကနေအလုပ်လုပ်ဆောင်ပေးသွားမှာဖြစ်ပါတယ်။ User view အနေနဲ့ အပြင်ပိုင်းကကြည့်မယ်ဆိုရင်တော့ stratis design မှာ underlying block devices ပါမယ် ပြီးရင် "virtual storage pool" ပြီးရင်သူ့အထက်မှာ "Filesystem" ဆိုပြီး ပါမှာဖြစ်ပါတယ်။

So, what is the back-store subsystem?

                     Back-store subsystem သည် underlying block devices တွေရဲ့ metadata တွေ ကို maintain လုပ်ပေးထားတယ် နောက် block device detection နဲ့ data တွေ ပျက်ခဲ့ရင် corruption ဖြစ်ခဲ့ရင် ပြန်ပြီး correct လုပ်ပေးပါတယ်။ အခုပြောတာတွေကို လုပ်ပေးနိုင်ဖို့ backstore subsystem layer ရဲ့ function တစ်ခု ဖြစ်တဲ့ "data tier" layer ကပြုလုပ်ပေးတာဖြစ်ပါတယ်။  နောက်ထပ် backstore function တစ်ခုဖြစ်တဲ့ "cache tier" ကျတော့ optional တစ်ခုအနေနဲ့ ဖြစ်ပြီး "data tier" ရဲ့အပေါ်မှာ high-performance devices (i.e SSD block devices) တွေကို cache tier တစ်ခုအနေနဲ့ သတ်မှတ်ချင်ရင် လုပ်ဆောင်ပေးပါတယ်။

What is another one called "thin pool subsystem" in Stratis?

                      Thinpool subsystem ကျတော့ top layer ပေါ်ရောက်သွားပြီ သူကကျတော့ thin-provisioned လုပ်ထားတဲ့ storage pool တွေကို manage လုပ်ပါတယ်။ ဒီ virtual storage pool တွေကို volume sizing ပိုင်း disk management ပိုင်း စတာတွေကို  manage လုပ်ဖို့အတွက် "dm-thin device-mapper" driver ကို အသုံးပြုပါတယ်။

What are the Stratis Supported devices?

                     အိုကေ ဒီတော့ ဘယ် underlying devices တွေက stratis ကို အသုံးပြုနိုင်သလဲ ဆိုတာ အောက်က list မှာ ဖော်ပြထားပါတယ်။ 
  1. HDDs and SSDs
  2. NVMe devices
  3. LVM-Logical Volume
  4. MD RAID
  5. dm-multipath
  6. iSCSI
  7. LUKS

What are the advanced features in Stratis?

                   Stratis ရဲ့ advanced feature တွေကတော့ သူ့မှာ built-in "thin-provisioned" feature ပါ၀င်တယ်။ ထို့ကြောင့် thin-provisioned လုပ်ထားပြီးသားဖြစ်တဲ့ devices တွေပေါ်မှာအသုံးပြုဖို့ Red Hat ကနေ recommended မလုပ်ထားပါဘူး။ နောက်တစ်ခုက LVM မှာလိုပဲ "volume snapshot" feature ပါ၀င်တယ်။ နောက်ပြီး storage monitoring feature စသည်တို့ပါ၀င်ပါတယ်။ 

So, as a conclusion what is the purpose of Stratis?

                Stratis ရဲ့ အဓိက ရည်ရွယ်ချက်ကတော့ သူ့အရှေ့က senior တွေဖြစ်တဲ့ "ZFS" တို့ "Btrfs" တို့ထက်ပိုပြီး အသုံးပြုရလွယ်ကူအောင် ပိုမိုအဆင်ပြေစေချင်တဲ့ရည်ရွယ်ချက်နဲ့ ပေါ်ပေါက်လာတာဖြစ်ပါတယ်။ Stratis ရဲ့တည်ဆောက်ပုံကလဲ storage  sizing ပိုင်းတွေမှာလဲ ဥပမာ ပြောရရင် LVM တို့ဆိုရင် user ကနေ Physical Vol, Vol Group, Locgical Vol ဆိုပြီး တောက်လျှောက် လိုက် control လုပ်နေရတယ်ပေါ့ Logical volume မှာ size တိုးချင်ရင် Vol group ကနေ လှမ်းပြီး manage လုပ်ရတာတို့လိုမျိုး ဒီ "Stratis" မှာကျတော့ storage management ပိုင်းတွေကို user ကနေ ၀င်ရောက် manage လုပ်စရာ မလိုတဲ့အထိ လုပ်ပေးထားတာဖြစ်ပါတယ်။ Stratis က တည်ဆောက်လိုက်တဲ့ storge pool တွေဟာ thin-provisioned ဖြစ်ပြီးသားဖြစ်တဲ့အတွက် အလိုအလျှာက် sizing ပိုင်းကို physical block device ထပ် add လိုက်တာနဲ့ auto manage လုပ်ပြီသားဖြစ်သွားပါတယ်။ အခုချိန်ထိကတော့ still developing ဖြစ်နေဆဲဖြစ်ပြီး နောက်ပိုင်းမှာတော့ mature state ကို ရောက်သွားမယ်လို့ခန့်မှန်းပါတယ်။ အောက်က ref မှာ Stratis FAQ မှာ ထပ်ပြီး detail သိချင်ရင် ကြည့်နိုင်ပါတယ်။

Ref:


That's it!
Thanks and Enjoy Reading!!! :) 
Follow and Like Root Of Info Page and Root Of Info Youtube Channel.

        

Share:

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.