View Source

{section}
{column:width=25%}

h5. [LDoms Community Cookbook]



h6. Contents

{pagetree:root=@parent|searchBox=true}

h6. In this Section ...

{toc:type=list|style=none|maxLevel=2}

{column}
{column:width=75%}

h1. Section Overview

This section contains scripts applicable to LDoms and orthogonal technologies. In some cases the scripts may not be located here and links are simply provided for convenience. For those posting scripts, please ensure you include a full description and any caveats and pre-requisites (LDoms/Platform/Solaris versions etc.)

h1. Administration Scripts


h2. Control and guest domain setup automatically


h3. Description

This script is kind of "Hello World" for LDOMs. It should serve as a starting point for someone who has a blank system and who does not want to study any docs to get LDOMs up and running.

The script has been tested on a T2000, a T5220, and a T5440 and LDOMs 1.0.3 and 1.1 (and it worked ;-) ). It requires a system with at least 24GB RAM and 24 operational threads, i.e. either 6 cores on a T2000 or 3 cores on a T2/T2\+ based system and a ZFS pool called "ldom-root" with enough space to install two Solaris 10 instances.

It does this, after system has been booted in "factory-default"
* Erase all existing spconfigs
* Reduce primary to 8 Threads and 4GB RAM, no MAUs/crypto units
* Configure a virtual switch on every physical NIC (the first physical NIC that appears in ifconfig \-a will be considered the main interface, see below)
* Configure one private virtual switch not assigned to any physical NIC (can be used to jumpstart all guests from the control domain)
* Configure one virtual disk service (as far as I know/learned the number of VDS has no incfluence on disk performance)
* Configure a virtual console service on ports 5000-5050
* Reconfigure system to use vsw instead of physical NIC
* Write a script to /etc/rc2.d that creates the guests
* Reboot
* during reboot two guests will be created:
** 8 threads, 8GB RAM, no MAU
** one vnet in the private virtual switch, one vnet in the main virtual switch (cf. above)
** Consoles share one vconsole group


Now one has two guests accessible via {{telnet 0 5000}}, the ls-spconfig now has two configs:
* "ctrl" Reduced primary domain with all VIO services, but no guests
* "ctrl,guests" same, but with the two guests

I use it as starting point for all experiments with LDOMs

h3. Author

Martin Müller, German Systems Practice and DC Ambassador, !email-pic.jpg!

h3. Prerequisites

LDOMs 1.0.3, LDOMs 1.1 (tested on build 12), tested on T2000, T5220, T5440. No idea why it should not work on all other sun4v systems

Usage:
* do a {{bootmode config="factory-default"}} on ALOM (haven't learned ILOM syntax yet)
* run it without parameters

h3. Download {{simple-dominator.sh}} [here|^simple-dominator.sh]

h2.
----
h2. LDoms Scripts for Demos


I have written some scripts as aids in demonstrating LDoms.  They are based on using ZFS file systems for each guest domain and a file within the ZFS file system as the boot disk.


h5. ldomcreatecontroldomain.sh

This script is used to configure the control domain after LDoms has been installed.  It determines how much memory (using prtconf(1M)) and how many CPUs (using mpstat(1)) the machine has and then prompts for how much memory and how many virtual CPUs to allocate to the control domain.  Next, a virtual switch is configured for each of the on-board physical network interfaces.  After executing all the necessary ldm(1M) commands, the configuration is saved to persist across power cycles.  Finally, instructions are printed to standard out instructing the user to reboot the system to instantiate the new configuration.

h5. ldomcreateguestdomain.ksh

This script is for creating a guest domain.  It first looks for any configured ZFS pools and figures out if any disks are available (using format(1M)) for creating a ZFS pool to create a ZFS file system for the new guest domain.  The script then collects the following information from the user:
* Name for the guest domain
* How many virtual CPUs to allocate (number of available is displayed)
* How much memory to allocate (amount available is displayed)
* Whether or not to allocate a specific virtual console port
*  Which virtual switch to use for the virtual network interface
* Size of the boot disk

It then creates the guest domain, saves the configuration for persistence across power cycles, prints to standard out instructions for accessing the console and the MAC address for JumpStart purposes.

h5. ldomcloneguestdomain.ksh

This script is for cloning a guest domain.  It is very similar to "ldomcreateguestdomain.ksh" except that it takes a ZFS snapshot of an existing guest domain and uses ZFS cloning to create an identical boot disk.  This makes for very speedy guest domain provisioning.

h5. ldomdestroy.sh

This script is for destroying guest domains.  It displays a list logical domains and prompts the user for the name of the domain to destroy.  The user is also prompted whether or not to destroy the boot device for the domain being destroyed.

h5. ldomdisable.sh

This script is used to disable ldoms and return the physical machine back to the factory default configuration.  It comes in handy when you need to repeat an LDoms demonstration.


h3. Author

Joe Cicardo
Systems Engineer
joe.cicardo@sun.com


h3. Prerequisites

Tested with LDoms version 1.1 on a T5240.


h4. All of the scripts in a tar bundle can be downloaded from

[^cicardo-ldom-scripts.tar]


----

h1. Other Scripts


h2. Example Script


h3. Example Script Description

This is an example script to show the layout for posting scripts. You would put a functional overview and usage information here.
{{Usage: example_script.sh <switch 1> <option 1\|option 2> <argument 1> etc. ...}}

h3. Author

Who to contact for feedback on the script

h3. Prerequisites

Works with LDoms version <version>, and all platforms etc.

h3. Download "Example Script" here << link to script
{column}
{section}

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact