← Solutions Notes

Huawei · OpenStack · Cinder Driver

Huawei Cinder Driver: install and configure, step by stepติดตั้งและตั้งค่า Huawei Cinder Driver ทีละขั้น

Getting Huawei block storage into OpenStack is a short list of steps with a long list of small ways to get one wrong. This is the order I work in on site, with the commands, the files, and the traps.การเอาสตอเรจ block ของ Huawei ไปต่อกับ OpenStack มีขั้นตอนไม่เยอะ แต่มีจุดเล็กๆ ที่พลาดได้เยอะมาก นี่คือลำดับที่ผมใช้ทำงานหน้างานจริง พร้อมคำสั่ง ไฟล์ และกับดักที่ควรรู้

Protocolsโปรโตคอล
iSCSI · FC · RoCE · TCP
OpenStackOpenStack
Mitaka → Gazpacho
Deploy modesรูปแบบติดตั้ง
Host · Kolla · RHOSOบนเครื่อง · Kolla · RHOSO
Stepsจำนวนขั้น
7

On this pageในหน้านี้

How the pieces fitภาพรวมการทำงาน

The Huawei Cinder driver is a set of Python files that sit inside the cinder-volume service. When someone asks OpenStack for a volume, cinder-volume calls the array’s REST API on port 8088 to create the LUN, the host object and the mapping. The data itself never goes through the Cinder node — each compute node talks to the array directly over iSCSI, Fibre Channel, or NVMe over RoCE or TCP.Huawei Cinder driver คือไฟล์ Python ชุดหนึ่งที่ไปอยู่ในเซอร์วิส cinder-volume เวลามีคนขอ volume จาก OpenStack ตัว cinder-volume จะเรียก REST API ของสตอเรจที่พอร์ต 8088 เพื่อสร้าง LUN สร้าง host และทำ mapping ให้ ส่วนข้อมูลจริงไม่ได้วิ่งผ่านเครื่อง Cinder เลย compute node แต่ละเครื่องคุยกับสตอเรจตรงๆ ผ่าน iSCSI, Fibre Channel หรือ NVMe over RoCE/TCP

OpenStackHuawei storageCinder API / schedulerpicks a backend by volume typecinder-volumeHuawei driver + your XML filenova-computeos-brick, multipathdDeviceManager RESThttps://array:8088/deviceManager/restStorage poolLUNs, hosts, mapping viewscreate / map / snapshot / deleteiSCSI · FC · NVMe over RoCE · NVMe over TCPDashed = control path (REST from the Cinder node). Solid = data path (from every compute node).
Two paths: control from the Cinder node, data from every compute node.สองเส้นทาง: คำสั่งควบคุมออกจากเครื่อง Cinder ส่วนข้อมูลออกจาก compute node ทุกเครื่อง

That split explains most of the setup work: the driver and its XML file live on the Cinder node, but multipathing, initiators and network reachability have to be right on every compute node too.การแยกสองเส้นทางนี้อธิบายงานติดตั้งเกือบทั้งหมด คือไดรเวอร์กับไฟล์ XML อยู่ที่เครื่อง Cinder แต่เรื่อง multipath, initiator และการมองเห็นกันทางเน็ตเวิร์ก ต้องถูกต้องบน compute node ทุกเครื่อง ด้วย

Check versionsand licenses1Get the driverHuawei GitHub2Copy into Cindernode or container3Write the XMLarray + initiators4Edit cinder.confbackend section5Restart + testservice up, volume ok6Multipath + typesthen features7
The whole job in seven steps — the rest of this page follows this order.งานทั้งหมดในเจ็ดขั้น เนื้อหาที่เหลือของหน้านี้เรียงตามลำดับนี้

Before you startเช็กก่อนเริ่ม

Versionsเวอร์ชันที่รองรับ

Sideฝั่งSupportedที่รองรับ
OpenStackMitaka → Gazpacho (21 releases)(21 รุ่น)
OceanStor V5V500R007C61, V500R007C71
OceanStor6.1.3, 6.1.5, 6.1.6, 6.1.7, 6.1.8, V700R001C00, C10, C20
OceanStor Dorado6.1.0, 6.1.2, 6.1.3, 6.1.5, 6.1.6, 6.1.7, 6.1.8, V700R001C00, C10, C20
OceanDiskV700R001

Protocol limitsข้อจำกัดของแต่ละโปรโตคอล

ProtocolโปรโตคอลOpenStackStorageสตอเรจNot availableใช้ไม่ได้
iSCSIall 21 releasesครบ 21 รุ่นall listed aboveทุกรุ่นข้างบน—
FCall 21 releasesครบ 21 รุ่นall listed aboveทุกรุ่นข้างบนneeds the sg3_utils toolsต้องลง sg3_utils
NVMe over RoCEZed (community) and three vendor builds: Pika, Queens, WallabyZed (community) และรุ่นที่ผู้ผลิตคลาวด์ปรับเอง: Pika, Queens, WallabyOceanStor / Dorado 6.1.6–6.1.8HyperMetro
NVMe over TCPEpoxy and laterEpoxy ขึ้นไปV700R001C10 and laterขึ้นไปHyperMetro, remote replicationremote replication

A compute node that already has iSCSI or FC volumes cannot simply be switched to RoCE or TCP. Either bring in a fresh compute node for the NVMe network (the cleaner option), or move every VM off the old one first.compute node ที่มี volume แบบ iSCSI หรือ FC อยู่แล้ว จะย้ายไปใช้ RoCE หรือ TCP ตรงๆ ไม่ได้ ต้องใช้ compute node ใหม่สำหรับเน็ตเวิร์ก NVMe (ทางที่สะอาดกว่า) หรือย้าย VM ออกจากเครื่องเดิมให้หมดก่อน

On the arrayฝั่งสตอเรจ

Which license unlocks whatไลเซนส์ไหนเปิดอะไร

OpenStack operationการทำงานใน OpenStackLicense on the arrayไลเซนส์บนสตอเรจ
Create / revert snapshot, snapshot consistency groupสร้าง / ย้อน snapshot, snapshot consistency groupHyperSnap
Volume from snapshot, backup of a snapshotสร้าง volume จาก snapshot, แบ็กอัพ snapshotHyperCopy / HyperClone
Volume from image, clone a volumeสร้าง volume จาก image, clone volumeHyperSnap + HyperCopy / HyperClone
Volume migrationย้าย volumeSmartMigration
QoSSmartQoS
Thin volumeThin volumeSmartThin
SmartTier / SmartCache / SmartPartitionthe license of the same nameไลเซนส์ชื่อเดียวกัน
HyperMetro volume or consistency groupHyperMetro volume หรือ consistency groupHyperMetro
Replication v2.1, replication consistency groupReplication v2.1, replication consistency groupHyperReplication
Create, attach, extend, delete, retype, multipath, multi-attachสร้าง, ต่อ, ขยาย, ลบ, retype, multipath, multi-attachnone neededไม่ต้องใช้

Model differences worth knowing earlyความต่างของแต่ละรุ่นที่ควรรู้ตั้งแต่แรก

Steps 1–2 · Get the driverขั้น 1–2 · ดาวน์โหลดไดรเวอร์

1Pick the sourceเลือกแหล่งไดรเวอร์

OpenStack itself ships a Huawei driver in cinder/volume/drivers/huawei, but the community only maintains two stable releases at a time and new features cannot be added after a release. Huawei keeps its own repository with all 21 releases patched. Use Huawei’s.ตัว OpenStack มีไดรเวอร์ Huawei ติดมาอยู่แล้วใน cinder/volume/drivers/huawei แต่ฝั่ง community ดูแลรุ่น stable แค่สองรุ่นล่าสุด และใส่ฟีเจอร์ใหม่ย้อนหลังไม่ได้ ส่วน Huawei มีที่เก็บของตัวเองที่แก้บั๊กให้ครบทั้ง 21 รุ่น แนะนำให้ใช้ของ Huawei

2Download and unpackดาวน์โหลดและแตกไฟล์

Open github.com/Huawei/OpenStack_Driver/releases, take the release marked Latest, and download Source code (zip). Inside, the Cinder folder has one sub-folder per OpenStack release.เปิด github.com/Huawei/OpenStack_Driver/releases เลือกรุ่นที่มีป้าย Latest แล้วโหลด Source code (zip) ข้างในโฟลเดอร์ Cinder จะแยกโฟลเดอร์ย่อยไว้ตามรุ่นของ OpenStack

bash
# on any machine with internet access (replace <tag> with the latest release tag)
curl -L -o OpenStack_Driver.zip https://github.com/Huawei/OpenStack_Driver/archive/refs/tags/<tag>.zip
unzip OpenStack_Driver.zip
ls OpenStack_Driver-*/Cinder/        # one folder per OpenStack release: Train, Yoga, Antelope, ...

Take the folder that matches your OpenStack release exactly — the driver files differ between releases. Copy only that folder to the Cinder node.เลือกโฟลเดอร์ที่ตรงกับรุ่น OpenStack ของคุณเป๊ะๆ เพราะไฟล์ไดรเวอร์แต่ละรุ่นไม่เหมือนกัน แล้วก๊อปปี้เฉพาะโฟลเดอร์นั้นไปที่เครื่อง Cinder

Step 3 · Put the driver into Cinderขั้น 3 · ติดตั้งไดรเวอร์ลง Cinder

Run this on every node that runs cinder-volume.ทำบนทุกเครื่องที่รัน cinder-volume

bash
# 1. find where cinder loads the Huawei driver from
python3 -c "from cinder.volume.drivers import huawei; print(huawei.__path__)"
#    (older nodes on Python 2: python -c "...")

DRV=/usr/lib/python3.9/site-packages/cinder/volume/drivers/huawei   # use the path printed above
REL=OpenStack_Driver-<tag>/Cinder/<OpenStack release>                # the folder you downloaded

# 2. keep a copy of what is there now
cp -a "$DRV" /root/huawei-driver-backup-$(date +%F)

# 3. swap in the new files
rm -f "$DRV"/*.py
cp "$REL"/*.py "$DRV"/
chmod 644 "$DRV"/*.py

# 4. confirm the driver classes you will reference in cinder.conf
grep -n "^class " "$DRV"/*driver*.py

Do not restart yet — the backend is not configured. That comes after steps 4 and 5.ยังไม่ต้องรีสตาร์ท เพราะยังไม่ได้ตั้งค่า backend ไว้ทำหลังขั้น 4 และ 5

Kolla-style deployments run cinder-volume in a container, so the files go into the container instead.ถ้าติดตั้งแบบ Kolla ตัว cinder-volume จะรันอยู่ใน container ไฟล์ไดรเวอร์จึงต้องเข้าไปอยู่ใน container แทน

bash
# 1. back up the current image so you can roll back
docker image ls | grep cinder-volume
docker save -o cinder_volume_backup.tar <cinder-volume image name>

# 2. stage the new files
mkdir huawei
cp OpenStack_Driver-<tag>/Cinder/<OpenStack release>/*.py huawei/
chmod 644 huawei/*.py

# 3. find the container and the drivers path inside it
docker ps | grep cinder_volume
docker exec -u 0 cinder_volume python3 -c "from cinder.volume import drivers; print(drivers.__path__)"

# 4. copy the folder in and restart
docker cp huawei/ cinder_volume:<path printed above>/
docker restart cinder_volume

docker cp changes the running container, not the image. The next deploy, reconfigure or upgrade that recreates the container brings the old driver back. Keep the huawei folder and re-apply it after every redeploy, or build it into your own cinder-volume image so it survives.docker cp แก้ container ที่รันอยู่ ไม่ได้แก้ image เวลา deploy, reconfigure หรืออัปเกรดจนมีการสร้าง container ใหม่ ไดรเวอร์เก่าจะกลับมา ให้เก็บโฟลเดอร์ huawei ไว้แล้วลงซ้ำหลัง deploy ทุกครั้ง หรือทำเป็น image cinder-volume ของตัวเองไปเลย

Step 4 · Write the XML fileขั้น 4 · เขียนไฟล์ XML

Everything about the array lives in one XML file on the Cinder node, usually /etc/cinder/cinder_huawei_conf.xml (the name is up to you). Pick your protocol — the choice is remembered further down the page too.ข้อมูลทั้งหมดของสตอเรจอยู่ในไฟล์ XML ไฟล์เดียวบนเครื่อง Cinder ส่วนใหญ่ตั้งชื่อว่า /etc/cinder/cinder_huawei_conf.xml (ตั้งชื่ออื่นได้) เลือกโปรโตคอลของคุณได้เลย หน้านี้จะจำตัวเลือกไว้ให้หัวข้อข้างล่างด้วย

/etc/cinder/cinder_huawei_conf.xml
<?xml version='1.0' encoding='UTF-8'?>
<config>
  <Storage>
    <Product>Dorado</Product>
    <Protocol>iSCSI</Protocol>
    <RestURL>https://192.0.2.10:8088/deviceManager/rest/;https://192.0.2.11:8088/deviceManager/rest/</RestURL>
    <UserName>cinder_admin</UserName>
    <UserPassword>********</UserPassword>
  </Storage>
  <LUN>
    <StoragePool>StoragePool001</StoragePool>
    <LUNType>Thin</LUNType>
    <LUNCopySpeed>2</LUNCopySpeed>
  </LUN>
  <iSCSI>
    <Initiator HostName="*" TargetIP="198.51.100.21 198.51.100.22"/>
  </iSCSI>
</config>
  • TargetIP = the array’s iSCSI logical ports, space-separated. On Dorado, OceanStor 6.1.x and OceanDisk: Services › Network › Logical Ports, protocol iSCSI. On V5: Provisioning › Port › Ethernet Ports.TargetIP คือ IP ของ logical port แบบ iSCSI บนสตอเรจ คั่นด้วยช่องว่าง บน Dorado, OceanStor 6.1.x และ OceanDisk ดูที่ Services › Network › Logical Ports เลือกโปรโตคอล iSCSI ส่วน V5 ดูที่ Provisioning › Port › Ethernet Ports
  • Instead of HostName you may use Name = the host IQN from /etc/iscsi/initiatorname.iscsi. Use one or the other, never both.ใช้ Name แทน HostName ได้ โดยใส่ IQN จาก /etc/iscsi/initiatorname.iscsi แต่เลือกอย่างใดอย่างหนึ่ง ห้ามใส่ทั้งคู่
  • On OceanStor V5 add the ALUA attributes to each Initiator — see the ALUA cheat sheet below. CHAP is optional (section “vStore, CHAP…”).ถ้าเป็น OceanStor V5 ให้เพิ่มค่า ALUA ลงใน Initiator แต่ละบรรทัด ดูที่หัวข้อสรุปค่า ALUA ส่วน CHAP ใส่เพิ่มได้ถ้าต้องการ (หัวข้อ vStore, CHAP…)
/etc/cinder/cinder_huawei_conf.xml
<?xml version='1.0' encoding='UTF-8'?>
<config>
  <Storage>
    <Product>Dorado</Product>
    <Protocol>FC</Protocol>
    <RestURL>https://192.0.2.10:8088/deviceManager/rest/;https://192.0.2.11:8088/deviceManager/rest/</RestURL>
    <UserName>cinder_admin</UserName>
    <UserPassword>********</UserPassword>
    <SSLCertVerify>True</SSLCertVerify>
    <SSLCertPath>/etc/cinder/huawei-array-ca.crt</SSLCertPath>
  </Storage>
  <LUN>
    <StoragePool>StoragePool001</StoragePool>
    <LUNType>Thin</LUNType>
    <LUNCopySpeed>2</LUNCopySpeed>
  </LUN>
  <FC>
    <MinOnlineFCInitiator>1</MinOnlineFCInitiator>
    <Initiator HostName="*"/>
  </FC>
</config>
  • Install sg3_utils on the Cinder and compute nodes first — the FC path needs the sg tools.ลง sg3_utils บนเครื่อง Cinder และ compute ก่อน เพราะงาน FC ต้องใช้เครื่องมือชุด sg
  • MinOnlineFCInitiator: how many of the host’s FC ports must be online before an attach is allowed. Leave it out and all of them must be online.MinOnlineFCInitiator คือจำนวนพอร์ต FC ของโฮสต์ที่ต้องออนไลน์ก่อนจะยอมต่อ volume ถ้าไม่ใส่ แปลว่าต้องออนไลน์ทุกพอร์ต
  • Name alternative = the host WWN from /sys/class/fc_host/*/port_name. Zoning can be done by hand or by the Cinder FC zone manager (section “vStore, CHAP…”).ถ้าใช้ Name ให้ใส่ WWN จาก /sys/class/fc_host/*/port_name ส่วน zoning ทำเองด้วยมือ หรือให้ FC zone manager ของ Cinder ทำให้ก็ได้
  • SSLCertVerify / SSLCertPath work on every protocol, not only FC — they are shown here because this is where the guide’s own example puts them.SSLCertVerify / SSLCertPath ใช้ได้กับทุกโปรโตคอล ไม่ใช่แค่ FC ที่ใส่ไว้ตรงนี้เพราะตัวอย่างในคู่มือวางไว้ตรงนี้
/etc/cinder/cinder_huawei_conf.xml
<?xml version='1.0' encoding='UTF-8'?>
<config>
  <Storage>
    <Product>Dorado</Product>
    <Protocol>nvmeof</Protocol>
    <RestURL>https://192.0.2.10:8088/deviceManager/rest/;https://192.0.2.11:8088/deviceManager/rest/</RestURL>
    <UserName>cinder_admin</UserName>
    <UserPassword>********</UserPassword>
  </Storage>
  <LUN>
    <StoragePool>StoragePool001</StoragePool>
    <LUNType>Thin</LUNType>
    <LUNCopySpeed>2</LUNCopySpeed>
  </LUN>
  <RoCE>
    <Initiator HostName="*" TargetIP="198.51.100.41 198.51.100.42"/>
  </RoCE>
</config>
  • Protocol is nvmeof, the section is <RoCE>, and Product can only be V6 or Dorado.Protocol ต้องเป็น nvmeof ส่วน section ชื่อ <RoCE> และ Product ใส่ได้แค่ V6 หรือ Dorado
  • No ALUA attributes here. Multipathing is native NVMe multipath on the host, not multipathd.ไม่ต้องใส่ค่า ALUA และ multipath ใช้ NVMe native multipath ของโฮสต์ ไม่ใช่ multipathd
  • Name alternative = the host NQN from /etc/nvme/hostnqn. TargetIP = logical ports with protocol RoCE.ถ้าใช้ Name ให้ใส่ NQN จาก /etc/nvme/hostnqn ส่วน TargetIP คือ logical port ที่เป็นโปรโตคอล RoCE
/etc/cinder/cinder_huawei_conf.xml
<?xml version='1.0' encoding='UTF-8'?>
<config>
  <Storage>
    <Product>Dorado</Product>
    <Protocol>nvmeof</Protocol>
    <RestURL>https://192.0.2.10:8088/deviceManager/rest/;https://192.0.2.11:8088/deviceManager/rest/</RestURL>
    <UserName>cinder_admin</UserName>
    <UserPassword>********</UserPassword>
  </Storage>
  <LUN>
    <StoragePool>StoragePool001</StoragePool>
    <LUNType>Thin</LUNType>
    <LUNCopySpeed>2</LUNCopySpeed>
  </LUN>
  <TCP>
    <Initiator HostName="*" TargetIP="198.51.100.51 198.51.100.52"/>
  </TCP>
</config>
  • Same shape as RoCE — Protocol nvmeof — but the section is <TCP> and Product should be Dorado.หน้าตาเหมือน RoCE คือ Protocol เป็น nvmeof แต่ section ชื่อ <TCP> และ Product ควรเป็น Dorado
  • Needs OpenStack Epoxy or later and array V700R001C10 or later. No HyperMetro and no remote replication.ต้องเป็น OpenStack Epoxy ขึ้นไป และสตอเรจ V700R001C10 ขึ้นไป ไม่มี HyperMetro และไม่มี remote replication
  • TargetIP = logical ports with data protocol TCP. Native NVMe multipath on the host.TargetIP คือ logical port ที่เป็นโปรโตคอล TCP และใช้ NVMe native multipath บนโฮสต์

The values that must be thereค่าที่ต้องมี

Elementค่าWhat to putใส่อะไร
ProductV5 for OceanStor V5, V6 for OceanStor 6.1.x, Dorado, or OceanDisk.V5 สำหรับ OceanStor V5, V6 สำหรับ OceanStor 6.1.x, Dorado หรือ OceanDisk
ProtocoliSCSI, FC, or nvmeof for RoCE and TCPหรือ nvmeof สำหรับ RoCE และ TCP
RestURLOne REST address per controller, separated by ;. Port 8088.ที่อยู่ REST ของแต่ละคอนโทรลเลอร์ คั่นด้วย ; พอร์ต 8088
UserName / UserPasswordThe dedicated OpenStack account (see Security).บัญชีที่สร้างไว้ให้ OpenStack โดยเฉพาะ (ดูหัวข้อความปลอดภัย)
StoragePoolExisting block pool(s), separated by ;.pool แบบ block ที่มีอยู่แล้ว ใส่หลายตัวคั่นด้วย ;
LUNTypeThin orหรือ Thick (Dorado and 6.1.x: Thin only)(Dorado และ 6.1.x ใช้ได้แค่ Thin)
LUNCopySpeed1 low · 2 medium · 3 high · 4 highest1 ช้า · 2 กลาง · 3 เร็ว · 4 เร็วสุด
InitiatorOne line per host group — see the rules below.หนึ่งบรรทัดต่อกลุ่มโฮสต์ ดูกติกาข้างล่าง

No value in this file may contain < > & ' ". That includes the password — pick one without those characters, or the driver will not parse the file.ค่าทุกตัวในไฟล์นี้ห้ามมีตัวอักษร < > & ' " รวมถึงรหัสผ่านด้วย ให้ตั้งรหัสที่ไม่มีตัวพวกนี้ ไม่อย่างนั้นไดรเวอร์จะอ่านไฟล์ไม่ออก

How HostName matching worksกติกาการจับคู่ HostName

xml · host groups
<iSCSI>
  <Initiator HostName="^compute-0[0-4]$" TargetIP="198.51.100.21 198.51.100.22"/>
  <Initiator HostName="^compute-0[5-9]$" TargetIP="198.51.100.23 198.51.100.24"/>
  <Initiator HostName="*"                TargetIP="198.51.100.21 198.51.100.23"/>
</iSCSI>

Optional tuningค่าปรับเพิ่มเติม (ไม่บังคับ)

Elementค่าDefaultค่าเริ่มต้นMeaningความหมาย
Semaphore20Max concurrent REST calls to the array (in <Storage>).จำนวน REST call พร้อมกันสูงสุด (อยู่ใน <Storage>)
WriteType11 write-back · 2 write-through. Dorado: write-back only.1 write-back · 2 write-through ส่วน Dorado ได้แค่ write-back
Prefetch Type / Value3 / 00 none · 1 constant · 2 variable · 3 intelligent.0 ไม่ prefetch · 1 คงที่ · 2 แปรผัน · 3 อัจฉริยะ
LUNCloneModeluncopyfastclone on Dorado 6.1.0+ only.fastclone ใช้ได้แค่ Dorado 6.1.0 ขึ้นไป
LUNcopyWaitInterval / Timeout5 s / 2592000 sHow often to poll a LUN copy, and when to give up (30 days).ความถี่ในการเช็กความคืบหน้า LUN copy และเวลาที่จะยอมแพ้ (30 วัน)
HyperSyncSpeed / ReplicaSyncSpeed2Sync speed for HyperMetro / replication pairs, 1–4.ความเร็ว sync ของคู่ HyperMetro / replication ตั้งได้ 1–4
SnapshotRollbackSpeed3Speed of revert-to-snapshot, 1–4.ความเร็วตอนย้อน snapshot ตั้งได้ 1–4
ForceDeleteVolumeFalseDelete a LUN even if it sits in several mapping views.ลบ LUN ได้แม้จะอยู่ในหลาย mapping view
HyperEnforceMultipathTrueRequire multipath for HyperMetro attaches.บังคับใช้ multipath เวลาต่อ volume แบบ HyperMetro
QosIgnoredParam—Front-end QoS keys the backend should ignore, ;-separated.คีย์ QoS ฝั่ง front-end ที่ให้ backend ข้ามไป คั่นด้วย ;

Step 5 · Point cinder.conf at the XMLขั้น 5 · ให้ cinder.conf ชี้ไปที่ไฟล์ XML

Add a backend section at the end of /etc/cinder/cinder.conf and list it in enabled_backends. The section name and volume_backend_name are yours to choose — they just have to match what you use in volume types later.เพิ่ม section ของ backend ไว้ท้ายไฟล์ /etc/cinder/cinder.conf แล้วใส่ชื่อไว้ใน enabled_backends ชื่อ section และ volume_backend_name ตั้งเองได้ ขอแค่ให้ตรงกับที่ใช้ใน volume type ภายหลัง

/etc/cinder/cinder.conf
[DEFAULT]
# add to the list if other backends already exist
enabled_backends = huawei_backend

[huawei_backend]
volume_driver = cinder.volume.drivers.huawei.huawei_driver.HuaweiISCSIDriver
cinder_huawei_conf_file = /etc/cinder/cinder_huawei_conf.xml
volume_backend_name = huawei_backend
retain_storage_mapping = False
# backend_host = cinder-cluster-1   # same value on every cinder-volume node sharing this backend

OceanDisk uses cinder.volume.drivers.huawei.ocean_disk_driver.OceanDiskISCSIDriver instead.ถ้าเป็น OceanDisk ให้ใช้ cinder.volume.drivers.huawei.ocean_disk_driver.OceanDiskISCSIDriver แทน

/etc/cinder/cinder.conf
[DEFAULT]
# add to the list if other backends already exist
enabled_backends = huawei_backend

[huawei_backend]
volume_driver = cinder.volume.drivers.huawei.huawei_driver.HuaweiFCDriver
cinder_huawei_conf_file = /etc/cinder/cinder_huawei_conf.xml
volume_backend_name = huawei_backend
retain_storage_mapping = False
# backend_host = cinder-cluster-1   # same value on every cinder-volume node sharing this backend

OceanDisk uses cinder.volume.drivers.huawei.ocean_disk_driver.OceanDiskFCDriver instead.ถ้าเป็น OceanDisk ให้ใช้ cinder.volume.drivers.huawei.ocean_disk_driver.OceanDiskFCDriver แทน

/etc/cinder/cinder.conf
[DEFAULT]
# add to the list if other backends already exist
enabled_backends = huawei_backend

[huawei_backend]
volume_driver = cinder.volume.drivers.huawei.huawei_roce_driver.HuaweiROCEDriver
cinder_huawei_conf_file = /etc/cinder/cinder_huawei_conf.xml
volume_backend_name = huawei_backend
retain_storage_mapping = False
# backend_host = cinder-cluster-1   # same value on every cinder-volume node sharing this backend

That class path is for Queens, Wallaby and Zed builds. On the Pika build the class lives in huawei_driver: cinder.volume.drivers.huawei.huawei_driver.HuaweiROCEDriver.path นี้ใช้กับ Queens, Wallaby และ Zed ถ้าเป็นรุ่น Pika คลาสจะอยู่ใน huawei_driver คือ cinder.volume.drivers.huawei.huawei_driver.HuaweiROCEDriver

/etc/cinder/cinder.conf
[DEFAULT]
# add to the list if other backends already exist
enabled_backends = huawei_backend

[huawei_backend]
volume_driver = cinder.volume.drivers.huawei.huawei_tcp_driver.HuaweiTCPDriver
cinder_huawei_conf_file = /etc/cinder/cinder_huawei_conf.xml
volume_backend_name = huawei_backend
retain_storage_mapping = False
# backend_host = cinder-cluster-1   # same value on every cinder-volume node sharing this backend

One class for all supported releases.ใช้คลาสเดียวกันทุกรุ่นที่รองรับ

Several cinder-volume nodes? Add a lockมี cinder-volume หลายเครื่อง ต้องมีตัวล็อก

With more than one cinder-volume node, add a distributed lock in [coordination]. The simplest is the same database Cinder already uses — copy user, password, host and database name from connection under [database], but write the scheme as mysql://.ถ้า cinder-volume มีมากกว่าหนึ่งเครื่อง ต้องเพิ่มตัวล็อกแบบกระจายใน [coordination] วิธีง่ายสุดคือใช้ฐานข้อมูลเดียวกับที่ Cinder ใช้อยู่ ก๊อปปี้ user, รหัสผ่าน, host และชื่อฐานข้อมูลจาก connection ใน [database] มาใส่ แต่เปลี่ยนขึ้นต้นเป็น mysql://

/etc/cinder/cinder.conf
[database]
connection = mysql+pymysql://cinder:<db-password>@<db-host>/cinder

[coordination]
backend_url = mysql://cinder:<db-password>@<db-host>/cinder?charset=utf8

Containers (Kolla)แบบ container (Kolla)

On the host, find the cinder-volume config with find / -name cinder.conf | grep volume and edit that file. Then create the XML inside the container (docker exec -it -u 0 cinder_volume bash, /etc/cinder/). Keep a copy of the XML outside the container as well, for the same reason as the driver files.บนเครื่อง host หาไฟล์ config ของ cinder-volume ด้วย find / -name cinder.conf | grep volume แล้วแก้ไฟล์นั้น จากนั้นสร้างไฟล์ XML ข้างใน container (docker exec -it -u 0 cinder_volume bash แล้วไปที่ /etc/cinder/) และเก็บสำเนา XML ไว้นอก container ด้วย ด้วยเหตุผลเดียวกับไฟล์ไดรเวอร์

Step 6 · Restart and testขั้น 6 · รีสตาร์ทและทดสอบ

Give the XML the same owner as cinder.conf, restart, and prove it works end to end with one small volume.ตั้งเจ้าของไฟล์ XML ให้เหมือน cinder.conf รีสตาร์ท แล้วพิสูจน์ว่าใช้ได้จริงด้วยการสร้าง volume เล็กๆ หนึ่งตัว

bash
# match the owner of cinder.conf, and keep the password away from other users
chown cinder:cinder /etc/cinder/cinder_huawei_conf.xml
chmod 640 /etc/cinder/cinder_huawei_conf.xml

systemctl restart openstack-cinder-volume.service   # Ubuntu: systemctl restart cinder-volume
                                                    # Kolla:  docker restart cinder_volume
sleep 30
openstack volume service list          # the ...@huawei_backend row must say: up

# a volume type bound to the backend, then one test volume
openstack volume type create huawei
openstack volume type set --property volume_backend_name=huawei_backend huawei
openstack volume create --type huawei --size 10 huawei-smoke-test
openstack volume show huawei-smoke-test -c status   # expect: available

If the service stays down, read /var/log/cinder/volume.log (or docker logs cinder_volume) before changing anything. The usual causes are a wrong class path in volume_driver, an unreachable RestURL, a pool name that does not exist, or a special character in the XML.ถ้าเซอร์วิสยังขึ้น down ให้อ่าน /var/log/cinder/volume.log (หรือ docker logs cinder_volume) ก่อนจะแก้อะไร สาเหตุที่เจอบ่อยคือ path คลาสใน volume_driver ผิด, ต่อ RestURL ไม่ถึง, ชื่อ pool ไม่มีอยู่จริง หรือมีอักขระพิเศษในไฟล์ XML

Finish the test by attaching the volume to a VM — that exercises the data path from the compute node, which the steps above do not touch.ปิดท้ายการทดสอบด้วยการต่อ volume นี้เข้ากับ VM สักตัว เพราะนั่นคือการทดสอบเส้นทางข้อมูลจาก compute node ซึ่งขั้นข้างบนยังไม่ได้แตะเลย

Step 7 · Multipathingขั้น 7 · Multipath

Without multipath, one failed link turns into I/O errors inside the guest, and file systems go read-only. It has to be set up in three places: the host, Nova, and Cinder.ถ้าไม่มี multipath สายเส้นเดียวขาด ก็จะกลายเป็น I/O error ใน VM และไฟล์ซิสเต็มจะกลายเป็นอ่านอย่างเดียว ต้องตั้งค่าสามที่ คือที่ตัวเครื่อง, ที่ Nova และที่ Cinder

This section is for iSCSI and FC. For NVMe over RoCE or TCP, use native NVMe multipathing as described in Huawei’s host connectivity guide for NoF — not multipathd.หัวข้อนี้สำหรับ iSCSI และ FC ถ้าเป็น NVMe over RoCE หรือ TCP ให้ใช้ NVMe native multipath ตามคู่มือ host connectivity แบบ NoF ของ Huawei ไม่ใช่ multipathd

1 · On every compute node1 · บน compute node ทุกเครื่อง

bash
# CentOS / RHEL
yum install -y device-mapper-multipath
mpathconf --enable
systemctl enable --now multipathd

# Ubuntu
apt-get install -y multipath-tools multipath-tools-boot
systemctl restart multipath-tools.service

# SUSE
zypper install -y multipath-tools
systemctl restart multipath-tools.service
chkconfig multipathd on

Then add a device block for Huawei arrays to /etc/multipath.conf. Pick the mode that matches your design:จากนั้นเพิ่ม device ของ Huawei ลงใน /etc/multipath.conf เลือกโหมดให้ตรงกับการออกแบบ

/etc/multipath.conf
devices {
    device {
        vendor               "HUAWEI"
        product              "XSG1"
        path_grouping_policy multibus
        path_checker         tur
        prio                 const
        path_selector        "service-time 0"
        failback             immediate
        no_path_retry        15
    }
}

All paths to all controllers are used equally.ใช้ทุกเส้นทางไปทุกคอนโทรลเลอร์เท่าๆ กัน

/etc/multipath.conf
devices {
    device {
        vendor               "HUAWEI"
        product              "XSG1"
        path_grouping_policy group_by_prio
        path_checker         tur
        prio                 alua
        path_selector        "round-robin 0"
        failback             immediate
        no_path_retry        15
    }
}

Paths to the nearer array (HyperMetro across sites) are used first, using ALUA priorities.ใช้เส้นทางไปสตอเรจที่ใกล้กว่าก่อน (เช่น HyperMetro ข้ามไซต์) โดยอาศัยลำดับความสำคัญจาก ALUA

bash
systemctl restart multipathd.service

If you started on OceanStor converged storage and later added Dorado, leave the existing multipath.conf as it is.ถ้าเริ่มจาก OceanStor แบบ converged แล้วมาเพิ่ม Dorado ทีหลัง ให้คงไฟล์ multipath.conf เดิมไว้ ไม่ต้องแก้

2 · Nova, on every compute node2 · Nova บน compute node ทุกเครื่อง

/etc/nova/nova.conf
[libvirt]
volume_use_multipath = True     # Mitaka and older: iscsi_use_multipath = True
bash
systemctl restart openstack-nova-compute.service

3 · Cinder, in the backend section3 · Cinder ใน section ของ backend

/etc/cinder/cinder.conf
[huawei_backend]
...
use_multipath_for_image_xfer = true
enforce_multipath_for_image_xfer = true
bash
systemctl restart openstack-cinder-volume.service

ALUA cheat sheetสรุปค่า ALUA

ALUA tells the array how to present paths to a host that uses third-party multipathing (like multipathd). The attributes go on each Initiator line in the XML. Getting them wrong is the usual cause of “alua not supported” in multipath -ll.ALUA คือการบอกสตอเรจว่าจะนำเสนอเส้นทางให้โฮสต์ที่ใช้ multipath ของค่ายอื่น (เช่น multipathd) อย่างไร ค่าพวกนี้ใส่ไว้ใน Initiator แต่ละบรรทัดในไฟล์ XML ถ้าตั้งผิด มักจะเห็นคำว่า “alua not supported” ใน multipath -ll

OceanStor V5OceanStor V5

CaseกรณีCentOS / RHELUbuntu / SUSE / Debian
No HyperMetroไม่มี HyperMetroALUA="1" FAILOVERMODE="3" SPECIALMODETYPE="0" PATHTYPE="0"ALUA="1" FAILOVERMODE="1" PATHTYPE="0"
HyperMetro · preferred arrayHyperMetro · สตอเรจฝั่งหลักALUA="1" FAILOVERMODE="3" SPECIALMODETYPE="0" PATHTYPE="0"ALUA="1" FAILOVERMODE="1" PATHTYPE="0"
HyperMetro · non-preferred arrayHyperMetro · สตอเรจฝั่งรองALUA="1" FAILOVERMODE="3" SPECIALMODETYPE="0" PATHTYPE="1"ALUA="1" FAILOVERMODE="1" PATHTYPE="1"

Without HyperMetro on V5 you may also leave ALUA out entirely. For reference: ALUA 0 = Huawei UltraPath, 1 = third-party multipath; FAILOVERMODE 0 early ALUA, 1 common ALUA, 2 no ALUA, 3 special ALUA; PATHTYPE 0 preferred, 1 non-preferred.ถ้า V5 ไม่มี HyperMetro จะไม่ใส่ ALUA เลยก็ได้ ความหมายของค่าคือ ALUA 0 = UltraPath ของ Huawei, 1 = multipath ค่ายอื่น / FAILOVERMODE 0 ALUA แบบเก่า, 1 ALUA ทั่วไป, 2 ไม่ใช้ ALUA, 3 ALUA แบบพิเศษ / PATHTYPE 0 เส้นหลัก, 1 เส้นรอง

OceanStor DoradoOceanStor Dorado

Case (any Linux)กรณี (Linux ทุกค่าย)Dorado onlyมีแต่ DoradoDorado added to existing V5เพิ่ม Dorado เข้าไปในระบบ V5 เดิม
No HyperMetroไม่มี HyperMetroleave ALUA outไม่ต้องใส่ ALUAACCESSMODE="1" HYPERMETROPATHOPTIMIZED="1"
HyperMetro · load balancingHyperMetro · กระจายโหลดleave ALUA outไม่ต้องใส่ ALUAACCESSMODE="1" HYPERMETROPATHOPTIMIZED="1"
HyperMetro · local preferred, preferred arrayHyperMetro · ใกล้ก่อน, ฝั่งหลักACCESSMODE="1" HYPERMETROPATHOPTIMIZED="1"ACCESSMODE="1" HYPERMETROPATHOPTIMIZED="1"
HyperMetro · local preferred, non-preferred arrayHyperMetro · ใกล้ก่อน, ฝั่งรองACCESSMODE="1" HYPERMETROPATHOPTIMIZED="0"ACCESSMODE="1" HYPERMETROPATHOPTIMIZED="0"

ACCESSMODE 0 = balanced (default), 1 = asymmetric. If both ACCESSMODE and ALUA are present, ACCESSMODE wins. Not used at all for RoCE or TCP.ACCESSMODE 0 = balanced (ค่าเริ่มต้น), 1 = asymmetric ถ้าใส่ทั้ง ACCESSMODE และ ALUA จะใช้ ACCESSMODE และไม่ต้องใช้เลยกับ RoCE หรือ TCP

Features through volume typesเปิดฟีเจอร์ผ่าน volume type

Every array feature is switched on the same way: make a volume type, give it extra specs, and create volumes of that type. The license must already be on the array.ฟีเจอร์ทุกตัวของสตอเรจเปิดด้วยวิธีเดียวกัน คือสร้าง volume type ใส่ extra spec แล้วสร้าง volume ด้วย type นั้น ไลเซนส์ต้องอยู่บนสตอเรจก่อนแล้ว

bash · the pattern
openstack volume type create gold
openstack volume type set --property volume_backend_name=huawei_backend gold
openstack volume type set --property capabilities:thin_provisioning_support='<is> true' gold
openstack volume create --type gold --size 10 test-gold
Featureฟีเจอร์Extra specsextra specLicenseไลเซนส์Notesหมายเหตุ
Thincapabilities:thin_provisioning_support='<is> true'SmartThin—
Thickcapabilities:thick_provisioning_support='<is> true'
provisioning:type='thick'
—Not on Dorado, 6.1.x, OceanDiskไม่มีใน Dorado, 6.1.x, OceanDisk
SmartQoScapabilities:QoS_support='<is> true' + a QoS spec (below)QoS spec (ดูข้างล่าง)SmartQoSHyperMetro: local LUN onlyHyperMetro ได้แค่ LUN ฝั่งตัวเอง
SmartTiercapabilities:smarttier='<is> true'
smarttier:policy=1
SmartTier0 none · 1 auto · 2 up · 3 down. Not on Dorado0 ไม่ย้าย · 1 อัตโนมัติ · 2 ขึ้นชั้นเร็ว · 3 ลงชั้นช้า ไม่มีใน Dorado
SmartCachecapabilities:smartcache='<is> true'
smartcache:cachename='<name>'
SmartCacheCache must exist on the array. Not on Doradoต้องมี cache บนสตอเรจอยู่แล้ว ไม่มีใน Dorado
SmartPartitioncapabilities:smartpartition='<is> true'
smartpartition:partitionname='<name>'
SmartPartitionPartition must exist. Not on Doradoต้องมี partition อยู่แล้ว ไม่มีใน Dorado
HyperMetrocapabilities:hypermetro='<is> true' + hypermetro_device in cinder.confใน cinder.confHyperMetroiSCSI / FC onlyเฉพาะ iSCSI / FC
ReplicationReplicationcapabilities:replication_enabled='<is> true'
replication_type='<in> sync' orหรือ async + replication_device
HyperReplicationDefault async. iSCSI / FC onlyค่าเริ่มต้น async เฉพาะ iSCSI / FC
PoolPoolpool_name=StoragePool001
pool_name='<or> Pool1 <or> Pool2'
—Not for HyperMetro volumesใช้กับ HyperMetro ไม่ได้
Disk typeชนิดดิสก์disk_type=ssd (ssd, sas, nl_sas, mix)
disk_type='<or> sas <or> ssd'
—Not for HyperMetro volumesใช้กับ HyperMetro ไม่ได้
SmartDedupecapabilities:dedup='<is> true'—Thin only. Mitaka: '<in> true'Thin เท่านั้น ถ้าเป็น Mitaka ใช้ '<in> true'
SmartCompressioncapabilities:compression='<is> true'—Thin only. Mitaka: '<in> true'Thin เท่านั้น ถ้าเป็น Mitaka ใช้ '<in> true'
Owning controllerคอนโทรลเลอร์เจ้าของ LUNcapabilities:huawei_controller='<is> true'
huawei_controller:controllername=CTE0.A
—Name from System › Hardware › Controllersดูชื่อที่ System › Hardware › Controllers
Application typeประเภทแอปของ LUNcapabilities:huawei_application_type='<is> true'
huawei_application_type:applicationname='<name>'
—Overrides the dedupe / compression settingsค่านี้ชนะการตั้ง dedupe / compression
FastClone--metadata fastclone=True when creating from a snapshot or volumeตอนสร้างจาก snapshot หรือ volume—Dorado 6.1.0+ and 6.1.x. Limits HyperMetro, replication, snapshots, clonesDorado 6.1.0+ และ 6.1.x จะจำกัดการใช้ HyperMetro, replication, snapshot, clone
Copy speedความเร็ว copy--metadata copyspeed=3—1–4, default 21–4 ค่าเริ่มต้น 2

QoS in practiceตั้ง QoS จริง

bash
openstack volume type set --property capabilities:QoS_support='<is> true' gold
cinder qos-create gold-qos IOType=2 maxIOPS=5000 maxBandWidth=200
cinder qos-associate <qos-spec-id> <volume-type-id>

HyperMetro and replicationHyperMetro และ replication

Both need the second array described inside the backend section of cinder.conf, then a restart, then the volume type property from the table.ทั้งสองอย่างต้องใส่ข้อมูลสตอเรจตัวที่สองไว้ใน section ของ backend ใน cinder.conf รีสตาร์ท แล้วค่อยตั้ง property ของ volume type ตามตาราง

/etc/cinder/cinder.conf
[huawei_backend]
...
hypermetro_device =
    storage_pool:StoragePool001,
    san_address:https://192.0.2.20:8088/deviceManager/rest/,
    san_user:cinder_admin,
    san_password:********,
    ssl_cert_verify:True,
    ssl_cert_path:/etc/cinder/remote-array-ca.crt,
    metro_domain:HyperMetroDomain_001,
    metro_sync_completed:True,
    iscsi_info:{HostName:*;TargetIP:198.51.100.31 198.51.100.32}
/etc/cinder/cinder.conf
[huawei_backend]
...
replication_device =
    backend_id:remote-dorado,
    storage_pool:StoragePool001,
    san_address:https://192.0.2.30:8088/deviceManager/rest/,
    san_user:cinder_admin,
    san_password:********,
    ssl_cert_verify:True,
    ssl_cert_path:/etc/cinder/remote-array-ca.crt,
    iscsi_info:{HostName:*;TargetIP:198.51.100.61 198.51.100.62}

vStore, CHAP, multiple backends and the restvStore, CHAP, หลาย backend และอื่นๆ

Several arrays or protocols side by sideหลายสตอเรจหรือหลายโปรโตคอลพร้อมกัน

One section and one XML file per backend. Volume types then choose between them by volume_backend_name.หนึ่ง backend ใช้หนึ่ง section และหนึ่งไฟล์ XML แล้วให้ volume type เลือกเอาตาม volume_backend_name

/etc/cinder/cinder.conf
[DEFAULT]
enabled_backends = dorado_fc, v5_iscsi

[dorado_fc]
volume_driver = cinder.volume.drivers.huawei.huawei_driver.HuaweiFCDriver
cinder_huawei_conf_file = /etc/cinder/cinder_huawei_conf_dorado_fc.xml
volume_backend_name = dorado_fc

[v5_iscsi]
volume_driver = cinder.volume.drivers.huawei.huawei_driver.HuaweiISCSIDriver
cinder_huawei_conf_file = /etc/cinder/cinder_huawei_conf_v5_iscsi.xml
volume_backend_name = v5_iscsi

vStore (multi-tenant) accountบัญชี vStore (แบ่ง tenant)

Add <vStoreName> to <Storage> and use the vStore user’s name and password. Dorado needs 6.1.3 or later. Automatic FC zoning does not work with vStore users.เพิ่ม <vStoreName> ไว้ใน <Storage> แล้วใช้ชื่อและรหัสผ่านของผู้ใช้ vStore ถ้าเป็น Dorado ต้อง 6.1.3 ขึ้นไป และ FC zoning อัตโนมัติใช้กับผู้ใช้ vStore ไม่ได้

CHAP on iSCSICHAP สำหรับ iSCSI

xml
<Initiator HostName="*" TargetIP="198.51.100.21 198.51.100.22" CHAPinfo="chapuser;Chap-Passw0rd-12"/>

Name and password are separated by ;. Name 4–223 characters; password 12–16 characters using at least three of upper case, lower case, digits and symbols, and not the name forwards or backwards. Remember the XML rule: no < > & ' ".ชื่อกับรหัสผ่านคั่นด้วย ; ชื่อยาว 4–223 ตัว รหัสผ่าน 12–16 ตัว ต้องมีอย่างน้อยสามแบบจากตัวใหญ่ ตัวเล็ก ตัวเลข และสัญลักษณ์ และห้ามซ้ำกับชื่อทั้งแบบตรงและกลับหลัง อย่าลืมกติกาของ XML ว่าห้ามมี < > & ' "

Certificate check on the REST connectionตรวจใบรับรองของการเชื่อมต่อ REST

Add <SSLCertVerify>True</SSLCertVerify> and <SSLCertPath> (the CA file) to <Storage>. With verification on and no path, the driver cannot connect at all.เพิ่ม <SSLCertVerify>True</SSLCertVerify> และ <SSLCertPath> (ไฟล์ CA) ไว้ใน <Storage> ถ้าเปิดตรวจแต่ไม่ใส่ path ไดรเวอร์จะต่อสตอเรจไม่ได้เลย

Backups from a snapshotแบ็กอัพจาก snapshot

With the cinder-backup service already working, add backup_use_temp_snapshot = True to the backend section and restart cinder-volume and cinder-backup. Backups are then taken from a temporary snapshot rather than the live volume.เมื่อเซอร์วิส cinder-backup ทำงานได้แล้ว ให้เพิ่ม backup_use_temp_snapshot = True ไว้ใน section ของ backend แล้วรีสตาร์ท cinder-volume และ cinder-backup การแบ็กอัพจะทำจาก snapshot ชั่วคราวแทน volume ที่กำลังใช้งาน

Automatic FC zoningFC zoning อัตโนมัติ

Optional. Configure the Cinder FC zone manager with your switch details, following the OpenStack FC zoning guide, and restart cinder-volume.ไม่บังคับ ถ้าจะใช้ให้ตั้ง FC zone manager ของ Cinder ด้วยข้อมูลสวิตช์ตามคู่มือ FC zoning ของ OpenStack แล้วรีสตาร์ท cinder-volume

In-band managementจัดการผ่านช่องทางข้อมูล (in-band)

For sites where the Cinder node cannot reach the array’s management network, commands can travel over the data path through Huawei’s host agent. It needs Dorado 6.1.3+, the In-Band_Agent on the host, <InBandOrNot>True</InBandOrNot>, the array serial number in <Storagesn>, and RestURL pointing at the local agent (https://127.0.0.1:8889/deviceManager/rest/) with the in-band account. The same keys exist for hypermetro_device and replication_device. The driver will not clean up in-band LUN resources for you when an array is retired.สำหรับที่ที่เครื่อง Cinder มองไม่เห็นเน็ตเวิร์กจัดการของสตอเรจ คำสั่งสามารถวิ่งผ่านเส้นทางข้อมูลโดยใช้ host agent ของ Huawei ได้ ต้องเป็น Dorado 6.1.3 ขึ้นไป ลง In-Band_Agent บนโฮสต์ ใส่ <InBandOrNot>True</InBandOrNot> ใส่หมายเลขเครื่องใน <Storagesn> และให้ RestURL ชี้ไปที่ agent ในเครื่อง (https://127.0.0.1:8889/deviceManager/rest/) พร้อมบัญชี in-band ค่าชุดเดียวกันนี้มีใน hypermetro_device และ replication_device ด้วย ข้อควรรู้คือเวลาปลดสตอเรจ ไดรเวอร์จะไม่ล้างทรัพยากร LUN แบบ in-band ให้

Red Hat OpenStack Services on OpenShift (RHOSO)Red Hat OpenStack บน OpenShift (RHOSO)

On RHOSO the control plane runs as pods, so the driver goes into a custom cinder-volume image and the XML goes into an OpenShift Secret. The example below uses RHOSO 18.0, which is based on Antelope — so take the Antelope folder of the driver.บน RHOSO ส่วนควบคุมรันเป็น pod ไดรเวอร์จึงต้องไปอยู่ใน image cinder-volume ที่ทำเอง ส่วนไฟล์ XML ไปอยู่ใน Secret ของ OpenShift ตัวอย่างนี้ใช้ RHOSO 18.0 ซึ่งมีฐานมาจาก Antelope จึงใช้โฟลเดอร์ Antelope ของไดรเวอร์

1Build the imageสร้าง image

bash
mkdir -p cinder-huawei-driver && cd cinder-huawei-driver
cp OpenStack_Driver-<tag>/Cinder/Antelope/*.py ./

cat > Dockerfile <<'EOF'
FROM registry.redhat.io/rhoso/openstack-cinder-volume-rhel9:18.0
USER root
COPY ./*.py /usr/lib/python3.9/site-packages/cinder/volume/drivers/huawei/
RUN mkdir -p /etc/cinder/huawei && chown cinder:cinder /etc/cinder/huawei
USER cinder
EOF

podman login -u <user> <internal-registry>
podman build -t <internal-registry>/openstack/cinder-volume-huawei:v1 .
podman push <internal-registry>/openstack/cinder-volume-huawei:v1

2Put the XML in a Secretเอา XML ไปไว้ใน Secret

Base64-encode the user name and password, prefix each with !$$$, and put those in UserName / UserPassword. Then create the Secret.เข้ารหัสชื่อผู้ใช้และรหัสผ่านเป็น base64 แล้วเติม !$$$ ไว้ข้างหน้า ใส่ลงใน UserName / UserPassword แล้วสร้าง Secret

bash
echo -n 'cinder_admin' | base64          # -> put "!$$$<output>" in <UserName>
echo -n '<array password>' | base64      # -> put "!$$$<output>" in <UserPassword>

oc create secret generic cinder-huawei-config \
  --from-file=cinder_huawei_conf.xml=./cinder_huawei_conf.xml -n openstack

Base64 is an encoding, not encryption. Anyone who can read the Secret can read the password — restrict who can read Secrets in the openstack namespace.base64 เป็นแค่การแปลงรูปแบบ ไม่ใช่การเข้ารหัส ใครอ่าน Secret ได้ก็อ่านรหัสผ่านได้ ต้องจำกัดสิทธิ์การอ่าน Secret ใน namespace openstack ด้วย

3Tell the control plane to use itบอก control plane ให้ใช้

openstack_version_override.yaml
apiVersion: core.openstack.org/v1beta1
kind: OpenStackVersion
metadata:
  name: openstack-control-plane        # must equal your OpenStackControlPlane name
  namespace: openstack
spec:
  customContainerImages:
    cinderVolumeImages:
      huawei-backend: "<internal-registry>/openstack/cinder-volume-huawei:v1"
bash
oc apply -f openstack_version_override.yaml -n openstack
oc get openstackcontrolplane openstack-control-plane -n openstack -o yaml > openstack_control_plane.yaml
openstack_control_plane.yaml · the part to add
spec:
  cinder:
    template:
      extraMounts:
        - extraVol:
            - mounts:
                - name: huawei-config
                  mountPath: /etc/cinder/huawei/cinder_huawei_conf.xml
                  subPath: cinder_huawei_conf.xml
                  readOnly: false
              propagation:
                - huawei-backend
              volumes:
                - name: huawei-config
                  secret:
                    secretName: cinder-huawei-config
      cinderVolumes:
        huawei-backend:
          networkAttachments:
            - storage
            - storageMgmt
          customServiceConfig: |
            [huawei-backend]
            volume_backend_name=huawei-backend
            volume_driver=cinder.volume.drivers.huawei.huawei_driver.HuaweiISCSIDriver
            cinder_huawei_conf_file=/etc/cinder/huawei/cinder_huawei_conf.xml
            retain_storage_mapping=False

networkAttachments must name NetworkAttachmentDefinitions that already exist and can reach the array (oc get network-attachment-definitions -n openstack). For several arrays, repeat the extraVol and cinderVolumes entries with their own names and Secrets.networkAttachments ต้องเป็นชื่อ NetworkAttachmentDefinition ที่มีอยู่แล้วและมองเห็นสตอเรจ (oc get network-attachment-definitions -n openstack) ถ้ามีหลายสตอเรจ ให้เพิ่ม extraVol และ cinderVolumes ซ้ำ โดยตั้งชื่อและ Secret แยกกัน

4Apply and checkapply แล้วตรวจสอบ

bash
oc apply -f openstack_control_plane.yaml -n openstack
oc get pods -n openstack | grep cinder-volume          # Running
oc logs -n openstack <cinder-volume-huawei-backend pod>
oc rsh openstackclient
openstack volume service list                          # huawei-backend: up
openstack volume backend pool list --long
openstack volume type create huawei-iscsi
openstack volume type set --property volume_backend_name=huawei-backend huawei-iscsi
openstack volume create --type huawei-iscsi --size 20 huawei-rhoso-test

Upgrading the driver laterการอัปเกรดไดรเวอร์ภายหลัง

When it goes wrongเวลามีปัญหา

SymptomอาการCause and fixสาเหตุและวิธีแก้
Mapping fails; Nova log says lsblk failedต่อ volume ไม่ได้ Nova log บอกว่า lsblk ล้มเหลวlsblk is missing on the compute node, or Nova cannot run it. Install util-linux and check permissions.เครื่อง compute ไม่มี lsblk หรือ Nova ไม่มีสิทธิ์รัน ให้ลง util-linux แล้วเช็กสิทธิ์
Volume from image fails: key signature_verified existsสร้าง volume จาก image ไม่ได้: key signature_verified existsKnown Cinder bug from Rocky on (launchpad 1823445). Set verify_glance_signatures = disabled in [DEFAULT].บั๊กของ Cinder ตั้งแต่ Rocky (launchpad 1823445) ให้ตั้ง verify_glance_signatures = disabled ใน [DEFAULT]
multipath -ll shows alua not supportedmultipath -ll ขึ้น alua not supportedmultipath.conf and the ALUA keys in the XML do not agree. Fix both (all compute nodes, all Cinder nodes), restart multipathd and cinder-volume, then re-attach existing volumes — e.g. by migrating or rebuilding the VMs.ค่าใน multipath.conf กับค่า ALUA ใน XML ไม่ตรงกัน แก้ทั้งสองที่ (compute และ Cinder ทุกเครื่อง) รีสตาร์ท multipathd และ cinder-volume แล้วต่อ volume เดิมใหม่ เช่นย้ายหรือ rebuild VM
VM delete or live migration fails: map in use, some paths failed faultyลบ VM หรือ live migrate ไม่ได้: map in use บางเส้นขึ้น failed faultyLVM on the compute host has grabbed the multipath device. Add a filter in /etc/lvm/lvm.conf so LVM only scans the host’s own disks, e.g. filter = ["a/sdb/", "r/.*/"].LVM ของเครื่อง compute ไปจับ multipath device ไว้ ให้ใส่ filter ใน /etc/lvm/lvm.conf ให้ LVM สแกนแค่ดิสก์ของเครื่องเอง เช่น filter = ["a/sdb/", "r/.*/"]
Re-creating a deleted volume fails: name already existsสร้าง volume ที่เพิ่งลบใหม่ไม่ได้ ชื่อซ้ำDorado / 6.1.x keep deleted LUNs in the array’s recycle bin. Turn the LUN recycle bin off on the array for OpenStack-managed pools.Dorado / 6.1.x เก็บ LUN ที่ลบไว้ในถังขยะของสตอเรจ ให้ปิดถังขยะ LUN บนสตอเรจสำหรับ pool ที่ OpenStack ใช้
Batch image-volume creation fails on Mitakaสร้าง volume จาก image หลายตัวพร้อมกันไม่ได้บน MitakaLeftover device paths (os-brick bug 1553730). Clean the stale paths, or get a fix from the cloud platform vendor.มี path ค้าง (บั๊ก os-brick 1553730) ให้ล้าง path ที่ค้างอยู่ หรือขอแพตช์จากผู้ทำแพลตฟอร์มคลาวด์
You must map a LUN by hand (e.g. image cache) without upsetting the driverต้อง map LUN เองด้วยมือ (เช่น image cache) โดยไม่กวนไดรเวอร์Copy the driver’s naming: host name as is (or MD5 of it if longer than 32 characters), then OpenStack_HostGroup_<host_id>, OpenStack_LunGroup_<host_id>, OpenStack_Mapping_View_<host_id>. On Dorado rename mapping views from the CLI: change mapping_view mapping_view_name=<old> name=<new>.ตั้งชื่อตามแบบของไดรเวอร์ คือชื่อ host ตามจริง (หรือ MD5 ของชื่อถ้ายาวเกิน 32 ตัว) แล้วตั้ง OpenStack_HostGroup_<host_id>, OpenStack_LunGroup_<host_id>, OpenStack_Mapping_View_<host_id> บน Dorado ต้องเปลี่ยนชื่อ mapping view ผ่าน CLI: change mapping_view mapping_view_name=<old> name=<new>
bash · the MD5 the driver uses for long host names
python3 -c "import hashlib; print(hashlib.md5('<host name>'.encode()).hexdigest())"

Where the guide disagrees with itselfจุดที่คู่มือเขียนไม่ตรงกันเอง

A few places in issue 01 of the configuration guide contradict each other. None of them is serious once you know, but each can cost an hour on site.คู่มือการตั้งค่าฉบับ issue 01 มีบางจุดที่เขียนขัดกันเอง รู้ไว้ก่อนก็ไม่มีปัญหา แต่ถ้าไม่รู้อาจเสียเวลาหน้างานเป็นชั่วโมง

Securityความปลอดภัย

Referencesอ้างอิง