Having fun with Oracle's Solaris 11.1 Automated Installer
Preamble:
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 vdev=$(/usr/bin/aimanifest add -r target/logical/zpool[@name=rpool]/vdev@name rpool_vdev) |
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"/> </zpool |
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:
K=1024 # 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"/> </zvol> |
Whoop whoop!
This is really useful:
http://docs.oracle.com/cd/E26502_01/html/E28978/instal.html#glniv
Here's the list of variables available:
http://docs.oracle.com/cd/E26502_01/html/E28980/provision-2.html#provision-3
Maria MacCallum
Solaris 11.2 returns the value of SI_MEMSIZE in Mb’s now
07 Oct 2014, 15:27
Add a comment
You are not allowed to comment on this entry as it has restricted commenting permissions.