preload
Feb 05

Here is script howto mount guest VM to control domain VM. If you want to make file backups from snapshot or like in my case, configure new vm ( ip address etc ) one can easily modify it.

#!/bin/bash
# contact@mceith.com 2011

if [ ! -n "$1" -o ! -n "$2" -o ! -n "$3" ]; then
  echo "Usage: $0 <target vm uuid> <control domain uuid> mount|umount"
  exit 1
fi

case "$3" in
mount)
if [ -f /tmp/tmpvbd ]; then
  echo "VBD allready exists!"
  exit 1
fi

# Get uuid of vm you want to configure
VMUUID=`xe vbd-list vm-uuid=$1 params=vdi-uuid empty=false --minimal`

# Create VBD link to VM VDI on dom0
NEWVM=`xe vbd-create vm-uuid=$2 vdi-uuid=$VMUUID device=1`

# Plug it to dom0
xe vbd-plug uuid=$NEWVM

VM_VDEV=`xe vbd-list uuid=$NEWVM params=device --minimal`1

# Lag
sleep 1

# Mount it
mount /dev/$VM_VDEV /mnt/newvm

echo $NEWVM &gt; /tmp/tmpvbd
# Do what ever you like
# ....
;;

umount)

if [ ! -f /tmp/tmpvbd ]; then
  echo "No VBDs mounted?"
  exit 1
fi

umount /mnt/newvm

NEWVM=`cat /tmp/tmpvbd`

# Unplug
xe vbd-unplug uuid=$NEWVM

xe vbd-destroy uuid=$NEWVM

rm -f /tmp/tmpvbd
;;
esac

exit $?
Dec 18

One can manage Dell server with DRAC ( Dell Remote Access Controller ) via ssh session. iDRAC6 is little bit different than version 5. Here are the commands to access console and reboot / shutdown the server.

Connect:


$ ssh 192.168.1.19 -l root
root@192.168.1.19's password:
/admin1->

Access the console:


/admin1-> console com2

With DRAC5 one had to type:


Dell Remote Access Controller 5 (DRAC 5)
Firmware Version 1.20 (Build 07.03.02)

$ connect com2

To reboot the server type reset:


/admin1-> cd /system1
/admin1/system1
/admin1/system1-> reset

stop stands for poweroff and start for powerup.

In DRAC5 to use power functions one must first start SM CLP:


$ smclp
DRAC5 SM-CLP System Management Shell, version 1.0
Copyright (c) 2004-2007 Dell, Inc.
All Rights Reserved

I noticed that people end up this site with pattern “ssh reset drac”. If you are wondering how that is done, here it is:

ssh root@drac-ip
racadm racreset

This will reboot the DRAC if the web manage etc has crashed.

Dec 04

I had to upgrade OpenSolaris svn132 to new Oracle Solaris 11 express and this is what i learned.

iSCSI
We use comstar iscsi target which is also in solaris 11. First backup its configurations:


# svccfg export -a stmf > COMSTAR.backup

Bring all initiators offline and export zfs pools. If you get error that zpool is in use, you can delete luns with sbdadm delete-lu GUID ( dont worry, they will be imported later )

Now when you have freshly installed Solaris 11 express, export all the pools and restore the comstar backup:


# svccfg import COMSTAR.backup

Import luns with sbdadm import-lu /dev/zvol/rdsk/zpool/share and verify that the luns are up. After this enable stmf and verify that the target groups are restored from backup with stmfadm list-tg.

If everything is in place, you can start iscsi/target.