Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add MediaType #400

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions redfish/virtualmedia.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ type VirtualMedia struct {
ImageName string
// Inserted shall indicate whether media is present in the virtual media device.
Inserted bool
// Сonnection MediaType used
MediaType VirtualMediaType
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a property of the VirtualMedia object. Can you explain why this is needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes of course, look, I'll give you an example from a server where this is:
{
"@odata.id": "/redfish/v1/Managers/bmc/VirtualMedia/USB1",
"@odata.type": "#VirtualMedia.v1_3_0.VirtualMedia",
"Actions": {
"#VirtualMedia.EjectMedia": {
"target": "/redfish/v1/Managers/bmc/VirtualMedia/USB1/Actions/VirtualMedia.EjectMedia"
},
"#VirtualMedia.InsertMedia": {
"target": "/redfish/v1/Managers/bmc/VirtualMedia/USB1/Actions/VirtualMedia.InsertMedia"
}
},
"Id": "USB1",
"MediaType": "USBStick",
"MediaTypes": [
"CD",
"USBStick",
"HDD"
],
"Name": "Virtual Removable Media",
"Oem": {
"OpenBMC": {
"@odata.type": "#OemVirtualMedia.v1_0_0.VirtualMedia"
}
},
"TransferMethod": "Stream",
"WriteProtected": true
}
in https://redfish.dmtf.org/schemas/v1/VirtualMedia.v1_3_0.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stmcginnis Ping (=

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that property didn't exist in the 1.3.0 version of the object either (which, by the way, is quite old now).

I looked back to the 1.0.0 version of the VirtualMedia object to see if this was a deprecated field that was removed, but it doesn't exist there either.

It might be better to upgrade your BMC firmware, and/or file an issue with your vendor to let them know that they are not complying to the spec.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so in 1.6.4 this field is also present
Снимок экрана 2025-01-27 в 17 41 46

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Снимок экрана 2025-01-27 в 17 45 29

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it bother you that a string type is specified?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/DMTF/Redfish-Publications/blob/main/json-schema/VirtualMedia.v1_6_4.json#L180 points to the type definition. It is then used as the data type of the VirtualMedia.MediaTypes property. You can see under VirtualMedia.properties definitions there is only the one plural MediaTypes property defined using the MediaType data type.

I'm not sure if I understand what you are referring to with having a string type. Can you expand on that? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the device is not connected, all possible connection types are displayed. However, when the device is connected, it shows the specific type through which it is connected. This is so that you can later launch this virtual disk through One Time Boot or set the appropriate priority in the BIOS settings for the drive. If this parameter were not present, you would not know which type is being used for the connection.

// MediaTypes shall be the supported media types for this connection.
MediaTypes []VirtualMediaType
// Password shall represent the password to access the
Expand Down
Loading