Hi Adam,
For what it’s worth, I’m adding some automated provisioning of our hardware
into our SmartOS environment - when we originally deployed SmartOS, SDC hadn’t
yet been open-sourced (it had a hefty price tag associated with it, I seem to
remember).
I have added a patch[1] into our platform builds to do this - the
/system/boot/config_script file is provided by the boot loader (iPXE in our
case) via the bootfs mechanism and is invoked via that patch for any
un-configured hypervisors. If it isn’t provided, the box boots as a regular
SmartOS node and prompts for configuration.
In addition to this script, iPXE also populates a /system/boot/config file that
contains the appropriate /usbkey/config contents - we use iPXE’s variable
replacement to pull down the file corresponding to the system’s first MAC
address, and just use our hypervisor inventory to automatically populate those
static files on our boot servers. The neat thing is, once the boot loader is
finished, the system doesn’t actually need network access as the boot
filesystem already has the data it needs to provision, so this removed the
previous hacks I had on the platform which previously tried to run DHCP on the
first ethernet interface before the configuration script ran.
Anyway. The interesting bit of our iPXE config looks something along the lines
of:
kernel /tftpboot/${version}/platform/i86pc/kernel/amd64/unix -B
smartos=true${boot_args}
module /tftpboot/${version}/platform/i86pc/amd64/boot_archive type=rootfs
name=ramdisk
module /tftpboot/config_script type=file name=config_script
module /tftpboot/config/${net0/mac:hexhyp}.config type=file name=config
boot
For what it’s worth, in our environment we have a modest number of Dell
hypervisors that we PXE boot off a pair of Ubiquiti EdgeRouter Pro[2] that run
a custom firmware that adds basic HTTP and TFTP serving of files. Seems to work
quite well for our needs.
Thomas
[1] -
https://github.com/joshado/smartos-live/blob/fa_20150622/overlay/generic/smartdc/lib/smartos_prompt_config.sh#L510-L518
[2] - https://www.ubnt.com/edgemax/edgerouter-pro/
On 2 Jul 2015, at 22:37, Adam Faris via smartos-discuss
<[email protected]> wrote:
> Hi Joshua,
>
> On 7/2/15, 2:32 PM, "Joshua M. Clulow" <[email protected]> wrote:
>
>> Hi Adam,
>>
>> On 2 July 2015 at 14:02, Adam Faris via smartos-discuss
>> <[email protected]> wrote:
>>> How does one automate the interactive install process for the global
>>> zone? Maybe some undocumented Œ-B¹ parameters for specifying pool
>>> profiles with specific disks, or uploading a key/value file because
>>> bootparams.c reads in /tmp/bootparams? Of course I could be thinking of
>>> this wrong and should instead look at the SDC code for provisioning a
>>> host? Thanks for providing feedback on how this is done.
>>
>> I would recommend that if you are at the level of provisioning
>> multiple machines in a relatively hands-off way, you probably want to
>> look at deploying SDC rather than bare SmartOS.
>>
>> From a technical perspective: when a fresh, blank, SDC compute node
>> boots it doesn't automatically do anything. Instead, we pass in (via
>> DHCP) some bootparams that enable the "ur" agent, which is shipped in
>> the platform. This agent connects to a nominated AMQP broker and
>> waits for instructions. The management software in SDC is able to
>> trigger the hands-off setup process remotely via this agent.
>>
>> As far as automated setup, you could build your own platform image
>> that (using overlays, or local modifications) replaces the SmartOS
>> setup program (it's just a shell script) with anything you like.
>>
>> --
>> Joshua M. Clulow
>> UNIX Admin/Developer
>> http://blog.sysmgr.org
>
> Hi Joshua, I¹ll take a look at the SDC framework and thanks for the
> pointers.
>
-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription:
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com