Thursday, August 28, 2008

Solaris Zone Global Hardware Identification

How do you tell what physical hardware a zone resides on?

After creating zones on more than one or two physical hosts I lose track of what zones were on what physical hardware. My solution is to create a file on the global zone, suppose the physical server is called "sun-server":

echo sun-server >> /usr/local/global


The file /usr/local/global now contains the name of the physical host that the zone resides on.

For sparse zones the file on the global zone is visible so you don't have to create one there, but for whole zones you will need to run the command in the zone.

Simple and easy to check when you are on a host:

cat /usr/local/global
sun-server


Friday, August 22, 2008

SUN M5000 server

SUN's M500 server has a new management interface card called XSCF -- it's vastly different from the sc interface of the other ilo products.

Here are my notes from setting up our system. Note that ip and MAC addresses are bogus -- I've changed them from my system settings...

rebootxscf
- reboots the xscf system

XSCF> console -d 0
XSCF> showstatus
XSCF> showversion -c xcp -v [shows xcp firmware, version, openboot prom version
XSCF> showenvironment
XSCF> showenvironment temp
XSCF> showenvironment volt
XSCF> showhardconf
XSCF> showdcl -va [check domain id...]
XSCF> showdomainstatus -a
XSCF> showboards -a
XSCF> poweron -a [powers up all domains]
XSCF> poweroff -a [powers off all domains]
XSCF> poweron -d 0 [powers on domain 0]
XSCF> poweroff -d 0 [powers off domain 0]
XSCF> poweroff -f -d 0 [forces a power off domain 0]
XSCF> reset -d 0 por [resets domain 0]
XSCF> reset -d 0 xir [resets domain 0 with XIR reset]
XSCF> sendbreak -d 0 [sends break command to domain 0]
XSCF> setautologout -s 60 [sets autologout to 60 minutes]
XSCF> showautologout
XSCF> shownetwork -a
XSCF> setnetwork xscf#0-lan#0 -m 255.255.255.0 10.10.10.5
XSCF> sethostname xscf#0 fire-xscf
XSCF> sethostname -h host.org
XSCF> setroute -h host.org
XSCF> setnameserver 10.10.10.2 10.10.10.3
XSCF> setroute -c add -n 10.10.10.1 -m 255.255.255.0 xscf#0-lan#0

--------------------

I boot from a SAN, so here are the SAN FC disks:

{8} ok show-disks
a) /pci@2,600000/QLGC,qlc@0,1/fp@0,0/disk
b) /pci@2,600000/QLGC,qlc@0/fp@0,0/disk
q) NO SELECTION
Enter Selection, q to quit:

ok nvalias mydev /pci@2,600000/QLGC,qlc@0,1/fp@0,0/disk

{8} ok show-disks
a) /pci@2,600000/QLGC,qlc@0,1/fp@0,0/disk
b) /pci@2,600000/QLGC,qlc@0/fp@0,0/disk
q) NO SELECTION
Enter Selection, q to quit: b
/pci@2,600000/QLGC,qlc@0/fp@0,0/disk has been selected.
Type ^Y ( Control-Y ) to insert it in the command line.
e.g. ok nvalias mydev ^Y
for creating devalias mydev for /pci@2,600000/QLGC,qlc@0/fp@0,0/disk
{8} ok nvalias mydev /pci@2,600000/QLGC,qlc@0/fp@0,0/disk
{8} ok boot mydev - install
Boot device: /pci@2,600000/QLGC,qlc@0/fp@0,0/disk File and args: - install
QLogic QLE2462 Host Adapter Driver(SPARC): 1.17 03/31/06


-------------------------

Need to make a system snapshot for diagnostic purposes? Use this command:

snapshot -l -v -p xxxxxxxxx -t me@myhost.host.org:/tmp

-----------------

ok> boot mydev - install

ok> watch-net-all

ok> show-nets

XSCF> showhardconf

-----------------------

{8} ok devalias net /pci@3,700000/network@0,1
{8} ok devalias
net /pci@3,700000/network@0,1
san /pci@2,600000/QLGC,qlc@0,1/fp@0,0/disk
name aliases
{8} ok boot net - install
Boot device: /pci@3,700000/network@0,1 File and args: - install
1000 Mbps full duplex Link up
Requesting Internet Address for 0:15:36:3c:b7:65
Requesting Internet Address for
0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65
1000 Mbps full duplex Link up
Requesting Internet Address for
0:15:36:3c:b7:65
1000 Mbps full duplex Link up
Requesting Internet Address for
0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65

{8} ok nvunalias net
{8} ok nvunalias net1
{8} ok set-defaults
Setting NVRAM parameters to default values.

{8} ok reset-all
Resetting...

{8} ok devalias net /pci@3,700000/network@0
{8} ok boot net - install
Boot device: /pci@3,700000/network@0 File and args: - install
1000 Mbps full duplex Link up
Requesting Internet Address for
0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65
1000 Mbps full duplex Link up
Requesting Internet Address for
0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65

XSCF> sendbreak -d 1
Send break signal to DomainID 1?[y|n] :y
XSCF> reset -d 1 xir
DomainID to reset:01
Continue? [y|n] :y
01 :Reset

*Note*
This command only issues the instruction to reset.
The result of the instruction can be checked by the "showlogs power".

=----------------------

{8} ok cd /pci@3,700000/network@0
{8} ok ./properties
./properties ?
{8} ok .properties
status okay
assigned-addresses
00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000
phy-type mif
board-model 501-7289
version Sun PCI-E 1G Ethernet UTP Adapter FCode 1.10 06/11/02
model SUNW,pcie-northstar
d-fru-len
00000000
d-fru-off 00000000
d-fru-dev eeprom
s-fru-len
00000000
s-fru-off 00000000
s-fru-dev eeprom
compatible pciex8086,105e.108e.125e.6
pciex8086,105e.108e.125e
pciex108e,125e
pciex8086,105e.6
pciex8086,105e
pciexclass,020000
pciexclass,0200
reg
00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000
max-frame-size 00010000
address-bits 00000030
device_type network
name network
local-mac-address
0:15:36:3c:b7:65
fcode-rom-offset 0000e000
interrupts 00000001
cache-line-size 00000010
class-code 00020000
subsystem-id 0000125e
subsystem-vendor-id 0000108e
revision-id 00000006
device-id 0000105e
vendor-id 00008086

{8} ok nvalias net /pci@3,700000/network@0
{8} ok devalias
net /pci@3,700000/network@0
disk /pci@2,600000/QLGC,qlc@0,1/fp@0,0/disk
name aliases

{8} ok boot net - install
Boot device: /pci@3,700000/network@0 File and args: - install
1000 Mbps full duplex Link up
Requesting Internet Address for
0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65
1000 Mbps full duplex Link up
Requesting Internet Address for
0:15:36:3c:b7:65
Requesting Internet Address for 0:15:36:3c:b7:65
1000 Mbps full duplex Link up
1000 Mbps full duplex Link up

Requesting Internet address for
0:15:36:3c:b7:65
SunOS Release 5.10 Version Generic_120011-14 64-bit
Copyright 1983-2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.



------------
Need to turn off the IP filter firewall?

# svcs | grep ip
online Nov_21 svc:/network/ipfilter:default
# svcadm disable ipfilter
# svcs | grep ip

---------------

added 2 additional memory boards:

XSCF> addboard -c assign -d 0 00-2
XSCF> addboard -c assign -d 1 00-3

XSCF> showboards -va

-----------------

To disable secure mode in the console (which disables the break command):

XSCF> setdomainmode -d 0 -m secure=off
Diagnostic Level :min -> -
Secure Mode :on -> off
Autoboot :on -> -
The specified modes will be changed.
Continue? [y|n] :y
configured.
Diagnostic Level :min
Secure Mode :off (host watchdog: unavailable Break-signal:receive)
Autoboot :on (autoboot:on)

XSCF> sendbreak -y -d 0
Send break signal to DomainID 0?[y|n] :y

System now sits at the OK prompt:

Type 'go' to resume
{0} ok boot cdrom
Resetting...
POST Sequence 01
[.]
POST Sequence Complete.

Sun SPARC Enterprise M4000 Server, using Domain console
Copyright 2007 Sun Microsystems, Inc. All rights reserved.
Copyright 2007 Sun Microsystems, Inc. and Fujitsu Limited. All rights reserved.
OpenBoot 4.24.4, 32768 MB memory installed, Serial #3333333.
Ethernet address
0:15:36:3c:b7:65, Host ID: 99999999.

Rebooting with command: boot cdrom
Boot device: /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/disk@3,0:f File and args:
SunOS Release 5.10 Version Generic_120011-14 64-bit
Copyright 1983-2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
[.]

Virtual Interfaces (Solaris)

add virtual interface:

ifconfig ce0:1 plumb
ifconfig ce0:1 10.10.10.5 up

edit /etc/hosts and add ip address information
edit /etc/hostname.ce0:1 and add in name of the server

Copy a CDROM to an ISO (Solaris)

to copy a cdrom to an iso:

mkisofs -r -o /tmp/disk1.iso /media/disk1

CDROM mounting into a Solaris Zone

To make the cdrom available to a zone, first mount it in the
global zone, then reconfigure the non-global zone:

[curie/mnt/cdrom] zonecfg -z computezone
zonecfg:computezone> add fs
zonecfg:computezone:fs> set dir=/cdrom
zonecfg:computezone:fs> set special=/cdrom
zonecfg:computezone:fs> set type=lofs
zonecfg:computezone:fs> add options [ro,nodevices]
zonecfg:computezone:fs> end
zonecfg:computezone> commit
zonecfg:computezone> exit

reboot the zone and it will be available

CDROM mounting (Solaris)

To mount a cdrom:
----------------------

# iostat -En

Determine the name of the device by entering the following command:

ls -al /dev/sr* |awk '{print "/" $11}'

This command returns the name of the CD-ROM device.
In this example, the command returns the string /dev/dsk/c0t6d0s2.

Enter the following commands to mount the CD-ROM:

mkdir -p /cdrom/unnamed_cdrom
mount -F hsfs -o ro /dev/dsk/c0t6d0s2 /cdrom/unnamed_cdrom

where /dev/dsk/c0t6d0s2 represents the name of the device that was returned in the preceding step and /cdrom/unnamed_cdrom represents the CD-ROM mount directory.

Thursday, August 21, 2008

VMware Notes

Enable root login:
----------------------
vi /etc/ssh/sshd_config PermitRootLogin yes

service sshd restart

vdf -h

vmware-cmd -l [to list the locations of the sever config files]

vmware-cmd [path to configfile] removesnapshots

# vdf -h
Filesystem Size Used Avail Use% Mounted on /dev/cciss/c0d0p2 4.9G 1.5G 3.2G 31% / /dev/cciss/c0d0p1 99M 30M 64M 32% /boot none 131M 0 131M 0% /dev/shm /dev/cciss/c0d0p6 2.0G 79M 1.8G 5% /var/log /vmfs/devices 812G 0 812G 0% /vmfs/devices /vmfs/volumes/45ae0d3f-918a774d-c934-0018fe7f5524 402G 151G 250G 37% /vmfs/volumes/45ae0d3f-918a774d-c934-0018fe7f5524 /vmfs/volumes/dd5fb8f1-41086e80 17G 14G 2.8G 83% /vmfs/volumes/dist


# vmware-cmd -l
/vmfs/volumes/45ae0d3f-918a774d-c934-0018fe7f5524/host1.host.org/host1.host.org.vmx
/vmfs/volumes/45ae0d3f-918a774d-c934-0018fe7f5524/host2.host.org/host2.host.org.vmx

# vmware-cmd ./host2.host.org.vmx removesnapshots



try doing the following:
ntpdate -q 65.17.128.4

If you get failures saying operation not permitted, check your firewall config a
gain:

esxcfg-firewall -q | grep 123

If ntp is enabled then you should see a line ending with

udp dpt:123

If you don't see this then check try running your

esxcfg-firewall -e ntpClient


edit /etc/ntp.conf -- add in "server pool.ntp.org"
ntpdate pool.ntp.org
hwclock --systohc
chkconfig --level 3 ntpd on
chkconfig --list ntpd
/etc/init.d/ntpd start


---------

esxcfg-firewall --AllowOutgoing
esxcfg-firewall --blockOutgoing

To scan a patch bundle depot:
esxupdate -d http://www.host.org/esx35/ scan

To install the patch bundle:
esxupdate -d http://www.host.org/esx35/ update

To query the installed patch bundle:
esxupdate query


To summarize a patch bundle:
esxupdate -d http://www.host.org/esx35 info

To run a test patch install:
esxupdate -d http://www.host.org/esx35 --test update

-this will speed up the actual patching because
it will create the patch cache

To run from the VIC, click on the Update Manager, select/configure
the baseline and select the server and remediate.
It does the following:

python /usr/sbin/esxupdate --HA --flushcache -d
http://192.168.1.1:80/vci/hostupdates/hostupdate/esx/esx-3.5.0 scan

python /usr/sbin/esxupdate --HA -d
http://192.168.1.1:80/vci/hostupdates/hostupdate/esx/esx-3.5.0
-b ESX350-200806201-UG --maintenancemode=1 --noreboot update


-----------------------

Linux VMWare Tools:
-------------------
-install the rpm
-as root run: vmware-config-tools.pl
-reboot
-then when you want to run the tools: vmware-toolbox &


---------------------------------

How to manage maintenance mode by the command line/through a
script/enter maintenance mode from the service console?

vimsh -n -e /hostsvc/maintenance_mode_enter
vimsh -n -e /hostsvc/maintenance_mode_exit


Remove BigFix:

# rpm -ev BESAgent-7.1.1.315