All entries for Wednesday 11 September 2013

September 11, 2013

Having fun with Oracle's Solaris 11.1 Automated Installer


If I get any apostrophes wrong, hey I'm sorry, buy me chocolate and commiserate with my ignorance, please don't shout at me! (same goes for spelling, but people are more tolerant with that).

I'm intending this to be my AI diary as I keep forgetting important things, it's not supposed to be documentation, as documentation has to be perfect and I will eventually produce some lovely stuff, this is more like my on-going thoughts and discoveries.

Todays fun with derived manifests:

I'm trying stuff out with derived manifest at the moment, I've found the Oracle notes only go so far.

Here's how I have a mirrored root pool with spare disk :

/usr/bin/aimanifest add -r target/logical/zpool@name rpool
/usr/bin/aimanifest set target/logical/zpool[@name=rpool]@is_root true

vdev=$(/usr/bin/aimanifest add -r target/logical/zpool[@name=rpool]/vdev@name rpool_vdev)
/usr/bin/aimanifest set ${vdev}@redundancy mirror

vdev=$(/usr/bin/aimanifest add -r target/logical/zpool[@name=rpool]/vdev@name rpool_vdev_spare)
/usr/bin/aimanifest set ${vdev}@redundancy spare

The above bungs the below into the derived manifest

<zpool name="rpool" is_root="true">
<vdev name="rpool_vdev" redundancy="mirror"/>
<vdev name="rpool_vdev_spare" redundancy="spare"/>

Here's how to configure the swap to your own size:

zvol=$(/usr/bin/aimanifest add -r target/logical/zpool[@name=rpool]/zvol@name swap)
/usr/bin/aimanifest set ${zvol}@action create
/usr/bin/aimanifest set ${zvol}@use swap
/usr/bin/aimanifest add ${zvol}/size@val 64gb

In this example I wanted the swap to match memory size, but the variable was supposed to be in Mbytes but was actually in bytes, solaris didn't like the value as it was not a a multiple of volume block size (actual error was: InstallationLogger ERROR cannot create 'rpool/swap': volume size must be a multiple of volume block size) , to get around this I converted the value into Gbytes, but obviously when they fix this undocumented feature my script will need to be fixed also. You could say how about specifying the block size, but I would say don't think you can with manifests!

So then altogether it looks like this:

let G=${K}*${K}*${K}
let mem_size=${SI_MEMSIZE}/${G}

# some other stuff here

zvol=$(/usr/bin/aimanifest add -r target/logical/zpool[@name=rpool]/zvol@name swap)
/usr/bin/aimanifest set ${zvol}@action create
/usr/bin/aimanifest set ${zvol}@use swap
/usr/bin/aimanifest add ${zvol}/size@val ${mem_size}gb

Which bungs this into the derived manifest:

<zvol name="swap" action="create" use="swap">
<size val="63gb"/>

Whoop whoop!

This is really useful:

Here's the list of variables available:

September 2013

Mo Tu We Th Fr Sa Su
|  Today  | Oct
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29

Search this blog



Most recent comments

  • Hello, It was more for internal consumption, I will check it over and send you a version, can you em… by Maria MacCallum on this entry
  • Hello Maria, i don't see the script setup–, can you post it ? I'am looking too for an example… by FRANCISCO on this entry
  • Solaris 11.2 returns the value of SI_MEMSIZE in Mb's now by Maria MacCallum on this entry

Blog archive

Not signed in
Sign in

Powered by BlogBuilder