diff --git a/docs/api.md b/docs/api.md index 1a677a3b9a..9be413c131 100644 --- a/docs/api.md +++ b/docs/api.md @@ -36,6 +36,10 @@ communicate with them. * `idrac://` (or `idrac+http://` to disable TLS). * `idrac-virtualmedia://` to use virtual media instead of PXE for attaching the provisioning image to the host. + * `idrac-redfish://` may be used to manage iDRAC controller with the + Redfish protocol over HTTPS. The URL must also contain a path to + the Redfish API system endpoint. + `idrac-redfish://myhost.example/redfish/v1/Systems/System.Embedded.1` * Fujitsu iRMC * `irmc://:`, where `` is optional if using the default. * HUAWEI ibmc diff --git a/pkg/bmc/access_test.go b/pkg/bmc/access_test.go index 50075d16fc..d93f30781a 100644 --- a/pkg/bmc/access_test.go +++ b/pkg/bmc/access_test.go @@ -538,6 +538,18 @@ func TestStaticDriverInfo(t *testing.T) { vendor: "", }, + { + Scenario: "idrac redfish", + input: "idrac-redfish://192.168.122.1", + needsMac: true, + driver: "idrac", + boot: "ipxe", + management: "idrac-redfish", + power: "idrac-redfish", + raid: "no-raid", + vendor: "no-vendor", + }, + { Scenario: "ilo5 virtual media", input: "ilo5-virtualmedia://192.168.122.1", @@ -886,6 +898,18 @@ func TestDriverInfo(t *testing.T) { }, }, + { + Scenario: "idrac redfish", + input: "idrac-redfish://192.168.122.1/foo/bar", + expects: map[string]interface{}{ + "redfish_address": "https://192.168.122.1", + "redfish_system_id": "/foo/bar", + "redfish_password": "", + "redfish_username": "", + "redfish_verify_ca": false, + }, + }, + { Scenario: "idrac virtual media", input: "idrac-virtualmedia://192.168.122.1/foo/bar", diff --git a/pkg/bmc/redfish.go b/pkg/bmc/redfish.go index ef3479d174..11ac9df55c 100644 --- a/pkg/bmc/redfish.go +++ b/pkg/bmc/redfish.go @@ -9,6 +9,7 @@ func init() { schemes := []string{"http", "https"} RegisterFactory("redfish", newRedfishAccessDetails, schemes) RegisterFactory("ilo5-redfish", newRedfishAccessDetails, schemes) + RegisterFactory("idrac-redfish", newRedfishiDracAccessDetails, schemes) } func redfishDetails(parsedURL *url.URL, disableCertificateVerification bool) *redfishAccessDetails { @@ -24,6 +25,12 @@ func newRedfishAccessDetails(parsedURL *url.URL, disableCertificateVerification return redfishDetails(parsedURL, disableCertificateVerification), nil } +func newRedfishiDracAccessDetails(parsedURL *url.URL, disableCertificateVerification bool) (AccessDetails, error) { + return &redfishiDracAccessDetails{ + *redfishDetails(parsedURL, disableCertificateVerification), + }, nil +} + type redfishAccessDetails struct { bmcType string host string @@ -31,6 +38,10 @@ type redfishAccessDetails struct { disableCertificateVerification bool } +type redfishiDracAccessDetails struct { + redfishAccessDetails +} + const redfishDefaultScheme = "https" func (a *redfishAccessDetails) Type() string { @@ -110,3 +121,29 @@ func (a *redfishAccessDetails) VendorInterface() string { func (a *redfishAccessDetails) SupportsSecureBoot() bool { return true } + +// iDrac Redfish Overrides + +func (a *redfishiDracAccessDetails) Driver() string { + return "idrac" +} + +func (a *redfishiDracAccessDetails) BootInterface() string { + return "ipxe" +} + +func (a *redfishiDracAccessDetails) ManagementInterface() string { + return "idrac-redfish" +} + +func (a *redfishiDracAccessDetails) PowerInterface() string { + return "idrac-redfish" +} + +func (a *redfishiDracAccessDetails) RAIDInterface() string { + return "no-raid" +} + +func (a *redfishiDracAccessDetails) VendorInterface() string { + return "no-vendor" +}