用redfish 配置dell服务器raid

好久没有弄dell的机器了,作为一个和dell服务器打了快20年交道的人,肯定要弄弄新的玩意,以前写过一个redfish 的文档,现在都忘了,简单用dell的redfish处理6个服务器

首先 git clone https://github.com/dell/iDRAC-Redfish-Scripting
然后先清除原有的raid 配置,首先查询配置

python3 ResetConfigStorageREDFISH.py -ip 172.20.127.196 -u root -p xyz -r RAID.Slot.4-1  -c y

- Server controller(s) detected -

RAID.Slot.4-1
AHCI.Embedded.2-1
AHCI.Embedded.1-1

可以看到我们要操作的raid卡名字
然后清除现有raid 配置

python3 ResetConfigStorageREDFISH.py -ip 172.20.127.196 -u root -p xyz -r RAID.Slot.4-1

- WARNING, JobStatus not completed, current status: "Task successfully scheduled."
- WARNING, JobStatus not completed, current status: "Task successfully scheduled."
- current status: "Job in progress.", percent complete: "34"
- WARNING, JobStatus not completed, current status: "Job in progress.", percent complete: "34"


- WARNING, JobStatus not completed, current status: "Job in progress.", percent complete: "34"

- WARNING, JobStatus not completed, current status: "Job in progress.", percent complete: "34"

--- PASS, Final Detailed Job Status Results ---

ActualRunningStartTime: 2022-01-17T18:20:13
ActualRunningStopTime: 2022-01-17T18:22:53
CompletionTime: 2022-01-17T18:22:53
Description: Job Instance
EndTime: TIME_NA
Id: JID_424362534961
JobState: Completed
JobType: RAIDConfiguration
Message: Job completed successfully.
MessageId: PR19
Name: Configure: RAID.Slot.4-1
PercentComplete: 100
StartTime: 2022-01-17T10:17:33

配置raid,首先看一下现在的配置

python3  CreateVirtualDiskREDFISH.py  -ip 172.20.127.192 -u root -p xyz -v RAID.Slot.4-1

- Volume(s) detected for RAID.Slot.4-1 controller -

Disk.Virtual.239:RAID.Slot.4-1, Volume type: Mirrored, RAID type: RAID1
Disk.Virtual.238:RAID.Slot.4-1, Volume type: Mirrored, RAID type: RAID1
Disk.Virtual.237:RAID.Slot.4-1, Volume type: Mirrored, RAID type: RAID1



-----
CreateVirtualDiskREDFISH.py -ip 192.168.0.120 -u root -p calvin -C RAID.Slot.6-1 -V y -D Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.6-1 -R 0, this example will create a one disk RAID 0 volume')

python3  CreateVirtualDiskREDFISH.py  -ip 172.20.127.193 -u root -p xyz -C RAID.Slot.4-1 -V y -D Disk.Bay.2:Enclosure.Internal.0-1:RAID.Slot.4-1,Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.4-1 -R 1 --size 536870912000

我试了一下500GB,提示
ValueError: invalid literal for int() with base 10: '500GB'
靠,这玩意要求整数,算了一下500GB = 536870912000
追加到后面成功了,还没有看如何得到这个raid 剩下的未分配空间。
这里有一个计算器
https://www.flightpedia.org/convert/2200-gigabytes-to-bytes.html
500GB=536870912000
2200GB=2362232012800
931GB=999653638144
python3  CreateVirtualDiskREDFISH.py  -ip 172.20.127.193 -u root -p zetyun2013 -C RAID.Slot.4-1 -V y -D Disk.Bay.2:Enclosure.Internal.0-1:RAID.Slot.4-1,Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.4-1 -R 1 --size 53687091200093


最后成品如下:

python3 ResetConfigStorageREDFISH.py -ip 172.20.127.193 -u root -p  xyz -r RAID.Slot.4-1

python3  CreateVirtualDiskREDFISH.py  -ip 172.20.127.193 -u root -p xyz -C RAID.Slot.4-1 -V y -D Disk.Bay.2:Enclosure.Internal.0-1:RAID.Slot.4-1,Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.4-1 -R 1 --size 536870912000
python3  CreateVirtualDiskREDFISH.py  -ip 172.20.127.193 -u root -p xyz -C RAID.Slot.4-1 -V y -D Disk.Bay.2:Enclosure.Internal.0-1:RAID.Slot.4-1,Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.4-1 -R 1 --size 2362232012800
python3  CreateVirtualDiskREDFISH.py  -ip 172.20.127.193 -u root -p xyz -C RAID.Slot.4-1 -V y -D Disk.Bay.2:Enclosure.Internal.0-1:RAID.Slot.4-1,Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.4-1 -R 1 --size 999653638144
python3  CreateVirtualDiskREDFISH.py  -ip 172.20.127.193 -u root -p xyz -C RAID.Slot.4-1 -V y -D Disk.Bay.4:Enclosure.Internal.0-1:RAID.Slot.4-1 -R 0

你可能感兴趣的:(用redfish 配置dell服务器raid)