Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://<host>:<port>`, where `<port>` is optional if using the default.
* HUAWEI ibmc
Expand Down
24 changes: 24 additions & 0 deletions pkg/bmc/access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
37 changes: 37 additions & 0 deletions pkg/bmc/redfish.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -24,13 +25,23 @@ 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
path string
disableCertificateVerification bool
}

type redfishiDracAccessDetails struct {
redfishAccessDetails
}

const redfishDefaultScheme = "https"

func (a *redfishAccessDetails) Type() string {
Expand Down Expand Up @@ -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"
}