[ICN-481] metal3 provisioning fails for nvme devices Created: 09/Oct/20  Updated: 17/Dec/20  Resolved: 16/Nov/20

Status: Done
Project: Integrated Cloud Native NFV
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Todd Malsbary Assignee: Todd Malsbary
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

As found in a specific deploy, if the root device of the provisioned node is not /dev/sda, provisioning fails.

 



 Comments   
Comment by Todd Malsbary [ 16/Nov/20 ]

https://gerrit.akraino.org/r/c/icn/+/3893

Comment by Todd Malsbary [ 15/Oct/20 ]

Proof of concept is at https://github.com/malsbat/icn/tree/upgrade-baremetal-operator, using an unofficial baremetal-operator image.  The integratedcloudnative/baremetal-operator image needs to be built from the capm3-v0.3.2 tag of the upstream repo.

Comment by Todd Malsbary [ 09/Oct/20 ]

From https://github.com/metal3-io/baremetal-operator/blob/master/docs/api.md:

hardwareProfile

This field is deprecated. See rootDeviceHints instead.

The name of the hardware profile to use. The following are the current supported hardwareProfile settings and their corresponding root devices.

hardwareProfile Root Device
unknown /dev/sda
libvirt /dev/vda
dell HCTL: 0:0:0:0
dell-raid HCTL: 0:2:0:0
openstack /dev/vdb

NOTE: These are subject to change.

This table is located in baremetal-operator/pkg/hardware/profile.go:
 

        profiles[DefaultProfileName] = Profile{
               Name: DefaultProfileName,
               RootDeviceHints: RootDeviceHints{
                       DeviceName: "/dev/sda",
               },
               RootGB:  10,
               LocalGB: 50,
               CPUArch: "x86_64",
        }

The code that makes the choice is in baremetal-operator/pkg/provisioner/ironic/ironic.go:

        hwProf, err := hardware.GetProfile(p.host.HardwareProfile())
        ...
        if _, ok := ironicNode.Properties["root_device"]; !ok {
               op = nodes.AddOp
               p.log.Info("adding root_device")
        } else {
               op = nodes.ReplaceOp
               p.log.Info("updating root_device")
        }
        hints := map[string]string{}
        switch {
        case hwProf.RootDeviceHints.DeviceName != "":
               hints["name"] = hwProf.RootDeviceHints.DeviceName
        case hwProf.RootDeviceHints.HCTL != "":
               hints["hctl"] = hwProf.RootDeviceHints.HCTL
        }
        p.log.Info("using root device", "hints", hints)

Now, let's take a look at the BareMetalHost:

# kubectl -n metal3 get bmh
NAME          STATUS   PROVISIONING STATUS   CONSUMER   BMC                   HARDWARE PROFILE   ONLINE   ERROR
pod11-node2   OK       provisioned                      ipmi://10.10.110.12   unknown            true      

The profile is confirmed in the logs from the baremetal-operator:

{"level":"info","ts":1602018807.7891486,"logger":"baremetalhost_ironic","msg":"adding root_device","host":"pod11-node2"}{"level":"info","ts":1602018807.7891557,"logger":"baremetalhost_ironic","msg":"using root device","host":"pod11-node2","hints":{"name":"/dev/sda"}}

 

Generated at Sat Feb 10 06:00:18 UTC 2024 using Jira 9.4.5#940005-sha1:e3094934eac4fd8653cf39da58f39364fb9cc7c1.