If I create a RAID-1 Virtual Drive through XML API/ IMC SDK, it makes sense to specify the total size of VD.
virtualDriveName='test3' raidLevel='1' size='2000 MB' driveGroup='[1,2]'
writePolicy='Write Through' adminState='trigger'/>
If I create a RAID-5 in CIMC webgui, it will automatically calculate and popup total size.
However, I do the same to create RAID-5 VD through XML API or IMC SDK Python, it actually requires to specify the total size of VD but this is what I don't know.
is there any trick that I can bypass this argument 'size', and let the system to pick the max size?
This is standalone C-series 220/240 M3/4 (without UCSM)
Thanks in advance
There is an API Helper on the Create Virtual Drive Pop-Up where you can input desired VD configuration parameters and the "Generate XML API Request" button will provide you with the right API call (including VD size attribute). There is no way to auto-optimize the VD size via the XML API since it requires the size to be specified as part of the API call - this is the reason that the API helper was added to the GUI, and assuming you have the same drives and VD configuration across systems, this is something that can be re-used.
There is no trick to get the API to use the maximum shared size across all the specified drive for your RAID 5 config.
The size is a required field.
You would have to first query for the drives by classId
From the returned objects find the drives that are going to be part of the RAID 5 config and determine the maximum size that could be specified or if all the same size use the value in coercedSize attribute. Since the attribute is a text value with two letter size category (MB, GB, TB) you'll have to do some splitting and converting of the value.
Are you using the Python SDK or creating XML documents?
Hope that helps.