cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
713
Views
0
Helpful
2
Replies

CIMC RestApi - Create a storage VD

SamCU
Level 1
Level 1

Hello,

I want to create a storage VD  RAID1  MRAID12G controller , 2x HDDs  on C480M5 using RestApi. However it looks like one need to provide the size for it. How do you calculate the size ahead of time?   When I create a VD using controller UI, I don't have to provide the size as it is calculated by the controller.  Can not this be done via api ?

Please advise,

Thanks

1 Accepted Solution

Accepted Solutions

Yes, you can create a storage VD RAID1 on C480M5 using RestAPI without explicitly providing the size. When creating a RAID1 volume, the size is automatically determined by the smallest drive in the array. Since you are using 2x HDDs and the RAID1 mirrors the drives, the size will be equal to the size of the smallest drive.

Here's an example of how to create a RAID1 VD using RestAPI without specifying the size:

1. First, obtain the authentication token by sending a POST request to the login endpoint:

```
POST https://(server_ip)/api/aaaLogin.xml
Content-Type: application/xml

(aaaUser name="(username)" pwd="(password)"/)
```

2. Next, find the storage controller's DN (Distinguished Name):

```
GET https://(server_ip)/api/node/mo/sys/rack-unit-1/board/storage-SAS/controller-1.xml
```

3. Finally, create the RAID1 VD by sending a POST request with the controller's DN:

```
POST https://(server_ip)/api/node/mo/sys/rack-unit-1/board/storage-SAS/controller-1.xml
Content-Type: application/xml

(configConfMo cookie="(your_auth_token)" inHierarchical="false")
(inConfigs)
(pair key="sys/rack-unit-1/board/storage-SAS/controller-1")
(storageVirtualDriveCreateDesc)
(storageVirtualDriveCreator)
(adminAction)create(/adminAction)
(raidLevel)mirror(/raidLevel)
(spanDepth)1(/spanDepth)
(stripSize)64k(/stripSize)
(virtualDriveName)RAID1_VD(/virtualDriveName)
(/storageVirtualDriveCreator)
(/storageVirtualDriveCreateDesc)
(/pair)
(/inConfigs)
(/configConfMo)
```

Replace `(server_ip)`, `(username)`, `(password)`, and `(your_auth_token)` with appropriate values.

In this example, `raidLevel` is set to `mirror`, which corresponds to RAID1. The `spanDepth` value of `1` indicates a single RAID1 array. The `stripSize` can be adjusted based on your preference, but `64k` is a common value. The `virtualDriveName` can be customized as per your requirement.

The controller will automatically calculate the size for the RAID1 VD based on the smallest drive in the array.

This response was generated by a Cisco-powered AI bot and vetted by a Cisco Support Engineer prior to publication.
This is part of a monitored experiment to see if the bot can help answer questions alongside community members. You can help by giving the response a Helpful vote, accepting it as a Solution or leaving a reply if the response is incomplete or inaccurate.

View solution in original post

2 Replies 2

Yes, you can create a storage VD RAID1 on C480M5 using RestAPI without explicitly providing the size. When creating a RAID1 volume, the size is automatically determined by the smallest drive in the array. Since you are using 2x HDDs and the RAID1 mirrors the drives, the size will be equal to the size of the smallest drive.

Here's an example of how to create a RAID1 VD using RestAPI without specifying the size:

1. First, obtain the authentication token by sending a POST request to the login endpoint:

```
POST https://(server_ip)/api/aaaLogin.xml
Content-Type: application/xml

(aaaUser name="(username)" pwd="(password)"/)
```

2. Next, find the storage controller's DN (Distinguished Name):

```
GET https://(server_ip)/api/node/mo/sys/rack-unit-1/board/storage-SAS/controller-1.xml
```

3. Finally, create the RAID1 VD by sending a POST request with the controller's DN:

```
POST https://(server_ip)/api/node/mo/sys/rack-unit-1/board/storage-SAS/controller-1.xml
Content-Type: application/xml

(configConfMo cookie="(your_auth_token)" inHierarchical="false")
(inConfigs)
(pair key="sys/rack-unit-1/board/storage-SAS/controller-1")
(storageVirtualDriveCreateDesc)
(storageVirtualDriveCreator)
(adminAction)create(/adminAction)
(raidLevel)mirror(/raidLevel)
(spanDepth)1(/spanDepth)
(stripSize)64k(/stripSize)
(virtualDriveName)RAID1_VD(/virtualDriveName)
(/storageVirtualDriveCreator)
(/storageVirtualDriveCreateDesc)
(/pair)
(/inConfigs)
(/configConfMo)
```

Replace `(server_ip)`, `(username)`, `(password)`, and `(your_auth_token)` with appropriate values.

In this example, `raidLevel` is set to `mirror`, which corresponds to RAID1. The `spanDepth` value of `1` indicates a single RAID1 array. The `stripSize` can be adjusted based on your preference, but `64k` is a common value. The `virtualDriveName` can be customized as per your requirement.

The controller will automatically calculate the size for the RAID1 VD based on the smallest drive in the array.

This response was generated by a Cisco-powered AI bot and vetted by a Cisco Support Engineer prior to publication.
This is part of a monitored experiment to see if the bot can help answer questions alongside community members. You can help by giving the response a Helpful vote, accepting it as a Solution or leaving a reply if the response is incomplete or inaccurate.

Thanks.  A follow up question - Does Redfish api support this as well?

Review Cisco Networking products for a $25 gift card