Loading...
 

Solaris

1. Create a new user

# Create a normal user
$ sudo useradd -m USER

# Make them superuser
$ sudo usermod -P "System Administrator" -R root USER

# Add them to sudoers
$ sudo bash -c 'echo "USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/svc-system-config-user'

2. Create a new zone

$ sudo zonecfg -z ZONE
create
commit
exit

$ sudo zoneadm -z ZONE install

$ sudo zoneadm -z ZONE boot

$ sudo zlogin -C ZONE

3. Configure LDOMs

3.1. Initial control domain config

Based on this and this.

$ sudo ldm add-vds primary-vds0 primary
$ sudo ldm add-vcc port-range=5000-5100 primary-vcc0 primary
$ sudo ldm add-vsw net-dev=net0 primary-vsw0 primary
$ sudo svcadm enable vntsd
$ sudo ldm set-crypto 1 primary # LDOM v1.3 no longer requires control domain to have 0 MAUs in order to shuffle CPUs
$ sudo ldm set-vcpu 4 primary
$ sudo ldm set-memory 16160M primary
$ sudo ldm add-config initial

3.2. Per-LDOM config

sudo ldm add-domain scite
sudo ldm add-vcpu 128 scite
sudo ldm add-memory 32G scite
sudo ldm add-vnet vnet1 primary-vsw0 scite
sudo zfs create -o sync=disabled -V 32G rpool/scite
sudo ldm add-vdsdev /dev/zvol/dsk/rpool/scite vol1@primary-vds0
sudo ldm add-vdisk vdisk1 vol1@primary-vds0 scite
sudo ldm set-variable auto-boot\?=false scite
sudo ldm set-variable boot-device=/virtual-devices@100/channel-devices@200/disk@0 scite

4. Modify Gentoo ISO to boot in a Logical Domain

The current Gentoo install-sparc64-minimal-20141201.iso doesn't boot in an LDom. It freezes at the mdraid scan step. To bypass this problem, I've removed the mdadm start script from the ISO. Here is the resulting gentoo-bkus.iso. If you'd like to create a new ISO yourself, follow these steps.

4.1. Modify Gentoo SPARC ISO to remove mdadm from startup

# On your Solaris box:
sudo lofiadm -a install-sparc64-minimal-20141201.iso
sudo mkdir -P /mnt/gentoo
sudo mount /dev/lofi/1 /mnt/gentoo
scp /mnt/gentoo/image.squashfs linux-box:

# Now on your linux-box:
unsquashfs image.squashfs
rm squashfs-root/etc/init.d/mdraid
mksquashfs image.squashfs squashfs-root

# Back to your Solaris box:
mkdir ~/gentoo-iso
cp -r /mnt/gentoo/* ~/gentoo-iso
scp linux-box:image.squashfs ~/gentoo-iso
mkisofs -N -D -R -d -l -J -G ~/gentoo-iso/boot/isofs.b -B ... -graft-points -relaxed-filenames -V "GentooSPARC" -o gentoo-sparc.iso