Thursday 25 September 2014

Configure ILOM for Remote Server Management - SUN servers

ILOM stands for Integrated Lights Out Manager, all T-series servers come with ILOM.
Using ILOM we can remotely manage the server including power off and power on, just like we are in front of the server.

But to access ILOM remotely, we need to configure it first. Items needed for remote access include:
  1. IP address
  2. Netmask
  3. Gateway
Additionally we can also give a friendly name for ILOM.

Let's assume our out-of-band access is in 192.168.200.0/255.255.255.0, the gateway for this network is 192.168.200.254
We are going to setup ILOM for a new server websvr01, with remote access IP 192.168.200.1.

Before ILOM is configured, we have to access it in the data center. Connect your laptop to the Serial Console. Login with default userid/password: root/changeme.
Once you are inside, you can setup ILOM.

To setup a friendly name:
cd /SP
set hostname=websvr01-ilom
To setup network:
cd /SP/network
set pendingipaddress=192.168.200.1
set pendingipnetmask=255.255.255.0
set pendingipgateway=192.168.200.254
set pendingipdiscovery=static
set commitpending=true
Instead of setting IP, netmask, gateway separately, we can also configure them in one command:
set pendingipaddress=192.168.200.1 pendingipnetmask=255.255.255.0 pendingipgateway=192.168.200.254

After that connecting Net Management port to proper port on switch, you will be able login remotely.

To access remotely:
ssh 192.168.200.1

After keying in user id and password, you will see the same interface as logging in through serial console.

Friday 18 April 2014

Sync data using Veritas Volume Manager

I have been using rsync to do data migration, recently I need to do data migration again.

Since this time the data resides in Veritas volumes, I want to try the Veritas way.

My setup in the old server is like this:

# vxprint -g ftpdg
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg ftpdg        ftpdg        -        -        -        -        -       -

dm ftpdg01      tagmastore-usp0_0 -   461350656 -       -        -       -
dm ftpdg02      tagmastore-usp0_1 -   31439616 -        -        -       -

v  volb         gen          ENABLED  461314816 -       ACTIVE   -       -
pl volb-01      volb         ENABLED  461314816 -       ACTIVE   -       -
sd ftpdg01-01   volb-01      ENABLED  461314816 0       -        -       -

v  vols         gen          ENABLED  31438848 -        ACTIVE   -       -
pl vols-01      vols         ENABLED  31438848 -        ACTIVE   -       -
sd ftpdg02-01   vols-01      ENABLED  31438848 0        -        -       -



I allocated two LUNs from storage, they are identified as tagmastore-usp0_2 and tagmastore-usp0_3.



To enable the new disks
# vxdctl enable

My privlen for old disks was 2048, so set the same value for new disks
# vxdisksetup -i tagmastore-usp0_2 privlen=2048
# vxdisksetup -i tagmastore-usp0_3 privlen=2048


Add the new disks to disk group:
# vxdg -g ftpdg adddisk ftpdg03=tagmastore-usp0_2
# vxdg -g ftpdg adddisk ftpdg04=tagmastore-usp0_3


Create sub disk and plex
# vxmake -g ftpdg sd ftpdg03-01 ftpdg03,0,461314816
# vxmake -g ftpdg plex volb-02

# vxmake -g ftpdg sd ftpdg04-01 ftpdg04,0,31438848
# vxmake -g ftpdg plex vols-02


Attach the plex to volumes
# vxplex -g ftpdg att volb volb-02
# vxplex -g ftpdg att vols vols-02


After attaching the plex, both old and new disks should have identical data, we can detach the new disks and add it to our new server.

Detach the new plex
# vxplex -g ftpdg det volb-02
# vxplex -g ftpdg det vols-02

Disassociate the new plex
# vxplex -g ftpdg dis volb-02
# vxplex -g ftpdg dis vols-02


Create new volume using the detached plex
# vxmake -g ftpdg vol newb plex=volb-02
# vxmake -g ftpdg vol news plex=vols-02


Split the diskgroup
# vxdg split ftpdg ftpdg2 newb news

At this step, we will have a diskgroup ftpdg2, inside it there are two volumes: newb and news.
We are planning to use the same volume names on new server, so rename the volumes in ftpdg2
# vxedit -g ftpdg2 rename newb volb
# vxedit -g ftpdg2 rename news vols

We can deport ftpdg2 from our old server:
# vxdg deport ftpdg2

On new server we can import ftpdg2 as ftpdg
# vxdg import -n ftpdg ftpdg2

We also need to start the volumes
# vxvol -g ftpdg start volb
# vxvol -g ftpdg start vols


The device path for the volumes are:
/dev/vx/dsk/ftpdg/volb
/dev/vx/dsk/ftpdg/vols


we can mount the volumes and start using it!

Tuesday 21 January 2014

407 Proxy Authentication Required

Recently I installed an Ubuntu box, following my windows configuration, I set my proxy as http://proxyhost:8080
But when I tried to wget something, I got this error:
"407 Proxy Authentication Required"

It turns out the proxy server requires my windows AD username/password. After googling around I found the software Cntlm (http://cntlm.sourceforge.net)
The installation and setup steps are quite straightforward:
  1. Download cntlm_0.92.3_amd64.deb from http://cntlm.sourceforge.net
  2. Installing cntlm
    # dpkg -i cntlm_0.92.3_amd64.deb
  3. Configure /etc/cntlm.conf
    Username        linuxscripter
    Domain          windows-domain
    Proxy           proxyhost:8080
    NoProxy         localhost, 127.0.0.*, 10.*, 192.168.*
    Listen          3128

  4. Generate encrypted password:
    # cntlm -H -M http://proxyhost:8080 -c /etc/cntlm.conf
    You will be prompted for Password, key in your windows AD password, and copy the command output and paste in /etc/cntlm.conf
  5. Restart cntlm service:
    # /etc/init.d/cntlm restart
  6. Set proxy to http://127.0.0.1:3128
My Ubuntu is ready to connect to outside world!