dell / iDRAC-Redfish-Scripting

Python and PowerShell scripting for Dell EMC PowerEdge iDRAC REST API with DMTF Redfish
GNU General Public License v2.0
598 stars 276 forks source link

how to expose a cloud-init configuration ? #241

Closed parmentelat closed 1 year ago

parmentelat commented 1 year ago

Hey there

this is somewhat related to #24, but it looks like a new issue is the right way to go

I'm playing with redfish in an attempt to automate booting off cloud images I am primarily targetting ubuntu, like e.g. https://releases.ubuntu.com/22.04/ubuntu-22.04.1-live-server-amd64.iso together with a minimal cloud-init config

being new to most of the technologies involved, I am facing a lot of moving pieces, so sorry if I am asking for the obvious here

so, I can trigger a reboot using BootToNetworkIsoOsdREDFISH.py --boot-iso however I am struggling to get this session to find my cloud-init configuration

to this end, I am exposing an ISO image through InsertEjectVirtualMediaREDFISH.py [[btw it seems like I can only use the cd OR the removabledisk device, but not both, at one given time, is that correct ?]] following a recipe along the lines described here: https://cloudinit.readthedocs.io/en/17.2/topics/datasources/nocloud.html#nocloud i.e. in a nutshell, the volume is named cidata and it contains 2 files named meta-data and user-data, the latter of which starts with #cloud-config

I was hoping that these naming conventions would cause cloud-init to find this config, but apparently it does not

so I guess my first question here is, is what I am trying to achieve supposed to be supported, or at least feasible ?

my firmware version is 5.10.50.00 and as for the Python code I use commit d6d776b

thanks in advance for any insight

texroemer commented 1 year ago

Hi @parmentelat

I'm not familiar with cloudinit but can answer your questions about Redfish actions. For OEM action DellOSDeploymentService.BootToNetworkISO, this only supports NFS and CIFS protocols. Since you are using HTTPS protocol for ISO location, use DMTF action VirtualMedia.InsertMedia to attach.

For attaching ISO and IMG file at the same time using DMTF action VirtualMedia.InsertMedia, this support was added starting in iDRAC 6.x versions. In 6.x iDRAC versions, you can now attach either two ISOs, one ISO and one IMG or two IMGs at the same time. The iDRAC version you have does not support attaching multiple virtual media devices at the same time. Also if flashing to iDRAC 6.x version, please check InsertEjectVirtualMediaREDFISH.py script examples because behavior has changed for attach/detach. Now you attach virtual media based off the index ID, not the device type.

Thanks Tex

parmentelat commented 1 year ago

Hello Tex, and thanks for the detailed answer, this is very helpful

I will definitely upgrade to 6.x

FYI, and also in case the same happens to others: when I went on the dell.com site to download an upgrade, the latest version was mentioned as 5.10.10.0 - which is even less than what I currently have !

it took me some time to figure out that the french page (I work in France) is outdated; I could find version 6 on https://www.dell.com/support/kbdoc/en-us/000178115/idrac9-versions-and-release-notes?lwp=rt while the french version here is behind https://www.dell.com/support/kbdoc/fr-fr/000178115/idrac9-versions-and-release-notes?lwp=rt (and to be complete, the only way to switch between these pages is by using the language selection drop down on top of the page)

in any case, thanks again 👍

texroemer commented 1 year ago

Thanks for letting me know about this issue with Dell release notes page not being accurate across all languages. I'll escalate this to internal teams at Dell to get fixed.

Thanks Tex

parmentelat commented 1 year ago

to summarize, with idrac firmware 6.x, I can

and doing a nextboot on device 1 results in cloudinit properly using my config

I'll close this issue then - thank you !

texroemer commented 1 year ago

Great to hear the workflow is working for you :)

Thanks Tex