Huawei · OpenStack · 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 มีขั้นตอนไม่เยอะ แต่มีจุดเล็กๆ ที่พลาดได้เยอะมาก นี่คือลำดับที่ผมใช้ทำงานหน้างานจริง พร้อมคำสั่ง ไฟล์ และกับดักที่ควรรู้
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
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 ทุกเครื่อง ด้วย
| Sideฝั่ง | Supportedที่รองรับ |
|---|---|
| OpenStack | Mitaka → Gazpacho (21 releases)(21 รุ่น) |
| OceanStor V5 | V500R007C61, V500R007C71 |
| OceanStor | 6.1.3, 6.1.5, 6.1.6, 6.1.7, 6.1.8, V700R001C00, C10, C20 |
| OceanStor Dorado | 6.1.0, 6.1.2, 6.1.3, 6.1.5, 6.1.6, 6.1.7, 6.1.8, V700R001C00, C10, C20 |
| OceanDisk | V700R001 |
| Protocolโปรโตคอล | OpenStack | Storageสตอเรจ | Not availableใช้ไม่ได้ |
|---|---|---|---|
| iSCSI | all 21 releasesครบ 21 รุ่น | all listed aboveทุกรุ่นข้างบน | — |
| FC | all 21 releasesครบ 21 รุ่น | all listed aboveทุกรุ่นข้างบน | needs the sg3_utils toolsต้องลง sg3_utils |
| NVMe over RoCE | Zed (community) and three vendor builds: Pika, Queens, WallabyZed (community) และรุ่นที่ผู้ผลิตคลาวด์ปรับเอง: Pika, Queens, Wallaby | OceanStor / Dorado 6.1.6–6.1.8 | HyperMetro |
| NVMe over TCP | Epoxy 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 ออกจากเครื่องเดิมให้หมดก่อน
| OpenStack operationการทำงานใน OpenStack | License on the arrayไลเซนส์บนสตอเรจ |
|---|---|
| Create / revert snapshot, snapshot consistency groupสร้าง / ย้อน snapshot, snapshot consistency group | HyperSnap |
| Volume from snapshot, backup of a snapshotสร้าง volume จาก snapshot, แบ็กอัพ snapshot | HyperCopy / HyperClone |
| Volume from image, clone a volumeสร้าง volume จาก image, clone volume | HyperSnap + HyperCopy / HyperClone |
| Volume migrationย้าย volume | SmartMigration |
| QoS | SmartQoS |
| Thin volumeThin volume | SmartThin |
| SmartTier / SmartCache / SmartPartition | the license of the same nameไลเซนส์ชื่อเดียวกัน |
| HyperMetro volume or consistency groupHyperMetro volume หรือ consistency group | HyperMetro |
| Replication v2.1, replication consistency groupReplication v2.1, replication consistency group | HyperReplication |
| Create, attach, extend, delete, retype, multipath, multi-attachสร้าง, ต่อ, ขยาย, ลบ, retype, multipath, multi-attach | none neededไม่ต้องใช้ |
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
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
# 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
Run this on every node that runs cinder-volume.ทำบนทุกเครื่องที่รัน cinder-volume
# 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*.pyDo 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 แทน
# 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_volumedocker 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 ของตัวเองไปเลย
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 (ตั้งชื่ออื่นได้) เลือกโปรโตคอลของคุณได้เลย หน้านี้จะจำตัวเลือกไว้ให้หัวข้อข้างล่างด้วย
<?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 PortsHostName 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 แต่เลือกอย่างใดอย่างหนึ่ง ห้ามใส่ทั้งคู่Initiator — see the ALUA cheat sheet below. CHAP is optional (section “vStore, CHAP…”).ถ้าเป็น OceanStor V5 ให้เพิ่มค่า ALUA ลงใน Initiator แต่ละบรรทัด ดูที่หัวข้อสรุปค่า ALUA ส่วน CHAP ใส่เพิ่มได้ถ้าต้องการ (หัวข้อ vStore, CHAP…)<?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>sg3_utils on the Cinder and compute nodes first — the FC path needs the sg tools.ลง sg3_utils บนเครื่อง Cinder และ compute ก่อน เพราะงาน FC ต้องใช้เครื่องมือชุด sgMinOnlineFCInitiator: 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 ที่ใส่ไว้ตรงนี้เพราะตัวอย่างในคู่มือวางไว้ตรงนี้<?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 หรือ Doradomultipathd.ไม่ต้องใส่ค่า ALUA และ multipath ใช้ NVMe native multipath ของโฮสต์ ไม่ใช่ multipathdName alternative = the host NQN from /etc/nvme/hostnqn. TargetIP = logical ports with protocol RoCE.ถ้าใช้ Name ให้ใส่ NQN จาก /etc/nvme/hostnqn ส่วน TargetIP คือ logical port ที่เป็นโปรโตคอล RoCE<?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>Protocol nvmeof — but the section is <TCP> and Product should be Dorado.หน้าตาเหมือน RoCE คือ Protocol เป็น nvmeof แต่ section ชื่อ <TCP> และ Product ควรเป็น DoradoTargetIP = logical ports with data protocol TCP. Native NVMe multipath on the host.TargetIP คือ logical port ที่เป็นโปรโตคอล TCP และใช้ NVMe native multipath บนโฮสต์| Elementค่า | What to putใส่อะไร |
|---|---|
| Product | V5 for OceanStor V5, V6 for OceanStor 6.1.x, Dorado, or OceanDisk.V5 สำหรับ OceanStor V5, V6 สำหรับ OceanStor 6.1.x, Dorado หรือ OceanDisk |
| Protocol | iSCSI, FC, or nvmeof for RoCE and TCPหรือ nvmeof สำหรับ RoCE และ TCP |
| RestURL | One REST address per controller, separated by ;. Port 8088.ที่อยู่ REST ของแต่ละคอนโทรลเลอร์ คั่นด้วย ; พอร์ต 8088 |
| UserName / UserPassword | The dedicated OpenStack account (see Security).บัญชีที่สร้างไว้ให้ OpenStack โดยเฉพาะ (ดูหัวข้อความปลอดภัย) |
| StoragePool | Existing block pool(s), separated by ;.pool แบบ block ที่มีอยู่แล้ว ใส่หลายตัวคั่นด้วย ; |
| LUNType | Thin orหรือ Thick (Dorado and 6.1.x: Thin only)(Dorado และ 6.1.x ใช้ได้แค่ Thin) |
| LUNCopySpeed | 1 low · 2 medium · 3 high · 4 highest1 ช้า · 2 กลาง · 3 เร็ว · 4 เร็วสุด |
| Initiator | One 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.ค่าทุกตัวในไฟล์นี้ห้ามมีตัวอักษร < > & ' " รวมถึงรหัสผ่านด้วย ให้ตั้งรหัสที่ไม่มีตัวพวกนี้ ไม่อย่างนั้นไดรเวอร์จะอ่านไฟล์ไม่ออก
HostName matching worksกติกาการจับคู่ HostNameHostName is a regular expression matched against the host name of each Nova or Cinder node. Check that hostname and /etc/hostname agree on every node.HostName คือ regular expression ที่ใช้จับกับชื่อเครื่องของ Nova หรือ Cinder แต่ละตัว ให้เช็กว่าคำสั่ง hostname กับไฟล์ /etc/hostname ได้ชื่อเดียวกันทุกเครื่องHostName="*" means “every host”. It is the simplest setup and is fine while the number of host connections stays inside the array’s per-controller connection limit.HostName="*" แปลว่าทุกเครื่อง ตั้งง่ายที่สุด ใช้ได้ตราบที่จำนวน connection ของโฮสต์ยังไม่เกินลิมิตต่อคอนโทรลเลอร์ของสตอเรจ*. When two specific patterns both match, the first one in the file wins.ถ้ามีทั้งแบบเจาะจงกับ * แบบเจาะจงชนะ ถ้าแบบเจาะจงสองบรรทัดจับได้ทั้งคู่ บรรทัดที่อยู่ก่อนในไฟล์ชนะ^ and $ for an exact match — otherwise Host1 also matches Host10.ใช้ ^ และ $ ถ้าต้องการจับชื่อแบบตรงตัว ไม่อย่างนั้น Host1 จะไปจับ Host10 ด้วยTargetIP set, as in the example below.ถ้า connection เกินลิมิต ให้แบ่งโฮสต์เป็นกลุ่ม แล้วให้แต่ละกลุ่มมีชุด TargetIP ของตัวเอง ตามตัวอย่างข้างล่าง<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>| Elementค่า | Defaultค่าเริ่มต้น | Meaningความหมาย |
|---|---|---|
| Semaphore | 20 | Max concurrent REST calls to the array (in <Storage>).จำนวน REST call พร้อมกันสูงสุด (อยู่ใน <Storage>) |
| WriteType | 1 | 1 write-back · 2 write-through. Dorado: write-back only.1 write-back · 2 write-through ส่วน Dorado ได้แค่ write-back |
| Prefetch Type / Value | 3 / 0 | 0 none · 1 constant · 2 variable · 3 intelligent.0 ไม่ prefetch · 1 คงที่ · 2 แปรผัน · 3 อัจฉริยะ |
| LUNCloneMode | luncopy | fastclone on Dorado 6.1.0+ only.fastclone ใช้ได้แค่ Dorado 6.1.0 ขึ้นไป |
| LUNcopyWaitInterval / Timeout | 5 s / 2592000 s | How often to poll a LUN copy, and when to give up (30 days).ความถี่ในการเช็กความคืบหน้า LUN copy และเวลาที่จะยอมแพ้ (30 วัน) |
| HyperSyncSpeed / ReplicaSyncSpeed | 2 | Sync speed for HyperMetro / replication pairs, 1–4.ความเร็ว sync ของคู่ HyperMetro / replication ตั้งได้ 1–4 |
| SnapshotRollbackSpeed | 3 | Speed of revert-to-snapshot, 1–4.ความเร็วตอนย้อน snapshot ตั้งได้ 1–4 |
| ForceDeleteVolume | False | Delete a LUN even if it sits in several mapping views.ลบ LUN ได้แม้จะอยู่ในหลาย mapping view |
| HyperEnforceMultipath | True | Require multipath for HyperMetro attaches.บังคับใช้ multipath เวลาต่อ volume แบบ HyperMetro |
| QosIgnoredParam | — | Front-end QoS keys the backend should ignore, ;-separated.คีย์ QoS ฝั่ง front-end ที่ให้ backend ข้ามไป คั่นด้วย ; |
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 ภายหลัง
[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 backendOceanDisk uses cinder.volume.drivers.huawei.ocean_disk_driver.OceanDiskISCSIDriver instead.ถ้าเป็น OceanDisk ให้ใช้ cinder.volume.drivers.huawei.ocean_disk_driver.OceanDiskISCSIDriver แทน
[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 backendOceanDisk uses cinder.volume.drivers.huawei.ocean_disk_driver.OceanDiskFCDriver instead.ถ้าเป็น OceanDisk ให้ใช้ cinder.volume.drivers.huawei.ocean_disk_driver.OceanDiskFCDriver แทน
[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 backendThat 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
[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 backendOne class for all supported releases.ใช้คลาสเดียวกันทุกรุ่นที่รองรับ
retain_storage_mapping: whether to keep the host’s mapping on the array after its last volume is detached. Default False.retain_storage_mapping คือจะเก็บ mapping ของโฮสต์ไว้บนสตอเรจหรือไม่ หลังจาก volume ตัวสุดท้ายถูกถอดออก ค่าเริ่มต้นคือ Falsebackend_host: set it when several cinder-volume nodes with different host names serve the same backend. As long as one of them is alive, the backend stays up.backend_host ใส่เมื่อมี cinder-volume หลายเครื่องที่ชื่อต่างกันดูแล backend เดียวกัน ขอแค่มีเครื่องหนึ่งยังทำงาน backend ก็ไม่ล่ม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://
[database]
connection = mysql+pymysql://cinder:<db-password>@<db-host>/cinder
[coordination]
backend_url = mysql://cinder:<db-password>@<db-host>/cinder?charset=utf8On 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 ด้วย ด้วยเหตุผลเดียวกับไฟล์ไดรเวอร์
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 เล็กๆ หนึ่งตัว
# 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: availableIf 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 ซึ่งขั้นข้างบนยังไม่ได้แตะเลย
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
# 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 onThen add a device block for Huawei arrays to /etc/multipath.conf. Pick the mode that matches your design:จากนั้นเพิ่ม device ของ Huawei ลงใน /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.ใช้ทุกเส้นทางไปทุกคอนโทรลเลอร์เท่าๆ กัน
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
systemctl restart multipathd.serviceIf you started on OceanStor converged storage and later added Dorado, leave the existing multipath.conf as it is.ถ้าเริ่มจาก OceanStor แบบ converged แล้วมาเพิ่ม Dorado ทีหลัง ให้คงไฟล์ multipath.conf เดิมไว้ ไม่ต้องแก้
[libvirt]
volume_use_multipath = True # Mitaka and older: iscsi_use_multipath = Truesystemctl restart openstack-nova-compute.service[huawei_backend]
...
use_multipath_for_image_xfer = true
enforce_multipath_for_image_xfer = truesystemctl restart openstack-cinder-volume.serviceALUA 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
| Caseกรณี | CentOS / RHEL | Ubuntu / SUSE / Debian |
|---|---|---|
| No HyperMetroไม่มี HyperMetro | ALUA="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 เส้นรอง
| Case (any Linux)กรณี (Linux ทุกค่าย) | Dorado onlyมีแต่ Dorado | Dorado added to existing V5เพิ่ม Dorado เข้าไปในระบบ V5 เดิม |
|---|---|---|
| No HyperMetroไม่มี HyperMetro | leave ALUA outไม่ต้องใส่ ALUA | ACCESSMODE="1" HYPERMETROPATHOPTIMIZED="1" |
| HyperMetro · load balancingHyperMetro · กระจายโหลด | leave ALUA outไม่ต้องใส่ ALUA | ACCESSMODE="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
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 นั้น ไลเซนส์ต้องอยู่บนสตอเรจก่อนแล้ว
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 spec | Licenseไลเซนส์ | Notesหมายเหตุ |
|---|---|---|---|
| Thin | capabilities:thin_provisioning_support='<is> true' | SmartThin | — |
| Thick | capabilities:thick_provisioning_support='<is> true'provisioning:type='thick' | — | Not on Dorado, 6.1.x, OceanDiskไม่มีใน Dorado, 6.1.x, OceanDisk |
| SmartQoS | capabilities:QoS_support='<is> true' + a QoS spec (below)QoS spec (ดูข้างล่าง) | SmartQoS | HyperMetro: local LUN onlyHyperMetro ได้แค่ LUN ฝั่งตัวเอง |
| SmartTier | capabilities:smarttier='<is> true'smarttier:policy=1 | SmartTier | 0 none · 1 auto · 2 up · 3 down. Not on Dorado0 ไม่ย้าย · 1 อัตโนมัติ · 2 ขึ้นชั้นเร็ว · 3 ลงชั้นช้า ไม่มีใน Dorado |
| SmartCache | capabilities:smartcache='<is> true'smartcache:cachename='<name>' | SmartCache | Cache must exist on the array. Not on Doradoต้องมี cache บนสตอเรจอยู่แล้ว ไม่มีใน Dorado |
| SmartPartition | capabilities:smartpartition='<is> true'smartpartition:partitionname='<name>' | SmartPartition | Partition must exist. Not on Doradoต้องมี partition อยู่แล้ว ไม่มีใน Dorado |
| HyperMetro | capabilities:hypermetro='<is> true' + hypermetro_device in cinder.confใน cinder.conf | HyperMetro | iSCSI / FC onlyเฉพาะ iSCSI / FC |
| ReplicationReplication | capabilities:replication_enabled='<is> true'replication_type='<in> sync' orหรือ async + replication_device | HyperReplication | Default async. iSCSI / FC onlyค่าเริ่มต้น async เฉพาะ iSCSI / FC |
| PoolPool | pool_name=StoragePool001pool_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 ไม่ได้ |
| SmartDedupe | capabilities:dedup='<is> true' | — | Thin only. Mitaka: '<in> true'Thin เท่านั้น ถ้าเป็น Mitaka ใช้ '<in> true' |
| SmartCompression | capabilities:compression='<is> true' | — | Thin only. Mitaka: '<in> true'Thin เท่านั้น ถ้าเป็น Mitaka ใช้ '<in> true' |
| Owning controllerคอนโทรลเลอร์เจ้าของ LUN | capabilities:huawei_controller='<is> true'huawei_controller:controllername=CTE0.A | — | Name from System › Hardware › Controllersดูชื่อที่ System › Hardware › Controllers |
| Application typeประเภทแอปของ LUN | capabilities: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 |
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>IOType: 0 read, 1 write, 2 both. Dorado and 6.1.x need 2.IOType 0 อ่าน, 1 เขียน, 2 ทั้งคู่ Dorado และ 6.1.x ต้องเป็น 2maxIOPS, maxBandWidth (MB/s). Guarantees: minIOPS, minBandWidth, latency (ms). On V5 you cannot mix limits and guarantees in one spec; Dorado and 6.1.x allow both but not latency.ค่าจำกัด: maxIOPS, maxBandWidth (MB/s) ค่าการันตี: minIOPS, minBandWidth, latency (ms) บน V5 ใส่ค่าจำกัดกับค่าการันตีใน spec เดียวกันไม่ได้ ส่วน Dorado และ 6.1.x ใส่ได้ทั้งคู่แต่ใช้ latency ไม่ได้burstIOPS, burstBandWidth, burstTime) are Dorado / 6.1.x only, and need the matching max value plus burstTime.ค่า IOPS บน Dorado ต้องไม่ต่ำกว่า 100 ส่วนค่า burst (burstIOPS, burstBandWidth, burstTime) มีแค่ Dorado / 6.1.x และต้องใส่ค่า max ที่คู่กันพร้อม burstTimeBoth 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 ตามตาราง
[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}[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}fc_info:{HostName:...} instead of iscsi_info. Add ALUA keys inside the braces when you need them.ถ้าเป็น FC ใช้ fc_info:{HostName:...} แทน iscsi_info และใส่ค่า ALUA ไว้ในวงเล็บปีกกาได้ถ้าจำเป็นssl_cert_verify is required from Rocky on. Before Rocky it is ignored, and both arrays must then have certificates from the same CA.ssl_cert_verify ต้องใส่ตั้งแต่ Rocky เป็นต้นไป ถ้าต่ำกว่า Rocky จะไม่อ่านค่านี้ และสตอเรจทั้งสองฝั่งต้องใช้ใบรับรองจาก CA เดียวกันbackend_id is the name you will use with cinder failover-host. Add vstore_name when the remote account is a vStore user.backend_id คือชื่อที่ใช้กับคำสั่ง cinder failover-host และใส่ vstore_name ถ้าบัญชีฝั่งปลายทางเป็นผู้ใช้ vStoreOne 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
[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_iscsiAdd <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 ไม่ได้
<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 ว่าห้ามมี < > & ' "
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 ไดรเวอร์จะต่อสตอเรจไม่ได้เลย
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 ที่กำลังใช้งาน
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
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 ให้
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 ของไดรเวอร์
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:v1Base64-encode the user name and password, prefix each with !$$$, and put those in UserName / UserPassword. Then create the Secret.เข้ารหัสชื่อผู้ใช้และรหัสผ่านเป็น base64 แล้วเติม !$$$ ไว้ข้างหน้า ใส่ลงใน UserName / UserPassword แล้วสร้าง Secret
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 openstackBase64 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 ด้วย
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"oc apply -f openstack_version_override.yaml -n openstack
oc get openstackcontrolplane openstack-control-plane -n openstack -o yaml > openstack_control_plane.yamlspec:
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=FalsenetworkAttachments 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 แยกกัน
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-testopenstack volume service list. If it fails, copy the backup back and restart.ถ้าติดตั้งบนเครื่องตรงๆ ให้สำรองโฟลเดอร์ไดรเวอร์ ก๊อปปี้ไฟล์ใหม่เข้าไป (สิทธิ์ 644) รีสตาร์ท cinder-volume แล้วเช็ก openstack volume service list ถ้าพังให้ก๊อปปี้ของสำรองกลับแล้วรีสตาร์ทdocker save, then repeat the docker cp steps. If it fails, restore the saved image.ถ้าเป็น Kolla ให้เก็บ image ไว้ด้วย docker save แล้วทำขั้น docker cp ซ้ำ ถ้าพังให้คืน image ที่เก็บไว้| 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 exists | Known 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 supported | multipath.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 faulty | LVM 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 หลายตัวพร้อมกันไม่ได้บน Mitaka | Leftover 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> |
python3 -c "import hashlib; print(hashlib.md5('<host name>'.encode()).hexdigest())"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 มีบางจุดที่เขียนขัดกันเอง รู้ไว้ก่อนก็ไม่มีปัญหา แต่ถ้าไม่รู้อาจเสียเวลาหน้างานเป็นชั่วโมง
HuaweiISCSIDriver, while its own example uses HuaweiFCDriver. Use HuaweiFCDriver for FC.คลาสของ FC หมายเหตุในบท FC บอกว่าสตอเรจที่ไม่ใช่ OceanDisk ให้ใช้ HuaweiISCSIDriver แต่ตัวอย่างในบทเดียวกันใช้ HuaweiFCDriver ให้ใช้ HuaweiFCDriver สำหรับ FChuawei_roce_driver.HuaweiROCEDriver and huawei_tcp_driver.HuaweiTCPDriver; the RHOSO chapter lists both under huawei_driver. Check which file really defines the class in your release: grep -n "^class " <driver dir>/*driver*.py.path ของ RoCE และ TCP บทติดตั้งใช้ huawei_roce_driver.HuaweiROCEDriver และ huawei_tcp_driver.HuaweiTCPDriver แต่บท RHOSO เขียนว่าอยู่ใน huawei_driver ทั้งคู่ ให้เช็กเองว่ารุ่นที่ใช้ประกาศคลาสไว้ในไฟล์ไหน ด้วย grep -n "^class " <driver dir>/*driver*.pyssl_sert_path; the examples use ssl_cert_path. The examples are the ones to copy.การสะกด ssl_cert_path ตารางของ HyperMetro และ replication สะกดเป็น ssl_sert_path แต่ตัวอย่างใช้ ssl_cert_path ให้ยึดตามตัวอย่างcinder:cinder with mode 640 — the 644 in the guide’s listing lets every local user read it.รหัสผ่านเป็นข้อความธรรมดา ไฟล์ XML เก็บรหัสผ่านสตอเรจไว้ตรงๆ อย่างน้อยให้ตั้งเจ้าของเป็น cinder:cinder และสิทธิ์ 640 เพราะ 644 ที่เห็นในคู่มือ ทำให้ผู้ใช้ทุกคนในเครื่องอ่านได้decrypt_cipher in cipher.py to decrypt with your own scheme, then store ciphertext in UserPassword, CHAP passwords, and san_password of hypermetro_device / replication_device. You own that code and must carry it forward on every driver upgrade.การเข้ารหัส ไดรเวอร์มาเป็นซอร์ส Python และเปิดช่องไว้ให้ คือแก้ฟังก์ชัน decrypt_cipher ใน cipher.py ให้ถอดรหัสด้วยวิธีของคุณเอง แล้วใส่ค่าที่เข้ารหัสแล้วใน UserPassword, รหัส CHAP และ san_password ของ hypermetro_device / replication_device โค้ดส่วนนี้เป็นของคุณเอง ต้องยกไปใส่ใหม่ทุกครั้งที่อัปเกรดไดรเวอร์SSLCertVerify with a CA file rather than trusting whatever answers on port 8088.ตรวจใบรับรองของสตอเรจ เปิด SSLCertVerify พร้อมไฟล์ CA แทนที่จะเชื่อใครก็ได้ที่ตอบมาจากพอร์ต 8088[coordination]-style URLs, Kolla host files, and RHOSO Secrets — protect those the same way.ระวังสำเนาที่อื่น รหัสผ่านยังไปโผล่ใน URL แบบ [coordination], ไฟล์บนเครื่อง host ของ Kolla และ Secret ของ RHOSO ต้องป้องกันที่พวกนั้นด้วยเหมือนกัน