2011/02/25

vcloud some more lessons learned: transfer volume

For my first vcloud cell I decided to make a seperate logical volume group that I could then export and share with other cloud cell. When I was done doing so I had the following result

A seperate logical volume in a seperate volume group
[root@abincloudhttp logs]# lvdisplay clouddata
--- Logical volume ---
LV Name /dev/clouddata/lvcloud
VG Name clouddata
LV UUID LCUjhy-vQxM-Taxn-0A2e-4ac7-F1UL-chl7dH
LV Write Access read/write
LV Status available
# open 1
LV Size 100.00 GB
Current LE 25599
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2

A new entry in fstab
[root@abincloudhttp logs]# cat /etc/fstab | grep clouddata
/dev/clouddata/lvcloud /opt/vmware/cloud-director/data/transfer/ ext3 defaults 1 2

And after everything was mounted via mount -a, a nice clean mount
[root@abincloudhttp logs]# df -h | grep transfer
99G 188M 94G 1% /opt/vmware/cloud-director/data/transfer

Also changed the export file
[root@abincloudhttp logs]# cat /etc/exports
/opt/vmware/cloud-director/data/transfer/ 0.0.0.0/0.0.0.0(rw,no_root_squash)

(This is poor security ofcourse as I should have used my local subnet/subnetmask and no_root_squash is not really good anyway :))

When I tried to start up my cloud cell, I got a 404 warnings that the application was not available. Not knowing where to look I started to google and found that the logs are kept on a straightforward location
/opt/vmware/cloud-director/logs/

In my cell.log I saw some errors about the transfer directory. I then realised that vcloud, made a seperate user vcloud. However by manually creating another volume group, I overwritten the default ownerships a shown below
[root@abincloudhttp data]# ls -alh
total 44K
drwxr-xr-x 6 vcloud vcloud 4.0K Feb 25 10:45 .
drwxr-xr-x 19 vcloud vcloud 4.0K Feb 25 10:31 ..
drwx------ 3 vcloud vcloud 4.0K Feb 25 10:45 activemq
drwx------ 2 vcloud vcloud 4.0K Feb 25 10:31 generated-bundles
drwxr-xr-x 3 root root 4.0K Feb 24 10:51 transfer
drwx------ 2 vcloud vcloud 4.0K Feb 25 10:45 txlog

a simple chown vcloud:vcloud transfer and service vmware-vcd restart solved the problem :)


2011/02/24

cloud director: some quick reminders

centos packages
  • yum install -y alsa-lib bash chkconfig compat-libcom_err coreutils findutils glibc grep initscripts krb5-libs libgcc libICE libSM libstdc libX11 libXau libXdmcp libXext libXi libXt libXtst module-init-tools net-tools pciutils procps redhat-lsb sed tar which libstdc++
post install certificates generation
  • cd /opt/vmware/cloud-director/
  • cd jre/bin/
  • mkdir /opt/vmware/cloud-director/keys
  • ./keytool -keystore /opt/vmware/cloud-director/certificates.ks -storetype JCEKS -storepass mysupersecretpass987654321 -genkey -keyalg RSA -alias http
  • ./keytool -keystore /opt/vmware/cloud-director/certificates.ks -storetype JCEKS -storepass mysupersecretpass987654321 -genkey -keyalg RSA -alias consoleproxy
  • ./keytool -keystore /opt/vmware/cloud-director/certificates.ks -storetype JCEKS -storepass mysupersecretpass987654321 -list

2011/02/19

Cheap Host Profiles Remake

I realised that setting up the host profiles before was complex. Since I was playing around with google app engine I thought to myself, lets do a remake. The result can be found here . Since I'm using GAE, I am using google API's to authenticate. Hence you can login with your gmail account. Notice that the acode part is an activation code. Please do not bookmark this url, is it just to activate your google account. Instead use this url once your account is "activated".

Basically it is the same syntax (a complete example is available in the "help" section) but better output :). Planning on doing some better error catching but basically if you don't do anything wrong, everything should work. Also thinking about maybe generating some documentation from the XML... we will see :)

2011/02/17

More vMA fun

Show the states of a path for every lun

for disk in $(esxcfg-scsidevs -m | sed 's/^\([^:]*\).*/\1/g'); do echo "Device $disk";esxcfg-mpath -l -d $disk | grep -e "State:" -e "Target Transport Details:"; done;

2011/01/06

Another oneliner : using esxcli to change to roundrobin

for disk in $(esxcli nmp device list | grep -B2 -e "Storage Array Type: VMW_SATP_SVC" | grep -e "^naa"); do echo "esxcli nmp device setpolicy --device $disk --psp VMW_PSP_RR";done;

Should find all SVC luns and echo the command to change the disk to round robin path policy. If you have identical ESX configs (like most clusters do), you can copy past the output to every esx host. For example

~ # for disk in $(esxcli nmp device list | grep -B2 -e "Storage Array Type: VMW_SATP_SVC" | grep -e "^naa"); do echo "esxcli nmp device setpolicy --device $disk --psp VMW_PSP_RR";done;
esxcli nmp device setpolicy --device naa.600507680181055b18000000000000f6 --psp VMW_PSP_RR
esxcli nmp device setpolicy --device naa.600507680181055b18000000000000f7 --psp VMW_PSP_RR
esxcli nmp device setpolicy --device naa.600507680181055b18000000000000f8 --psp VMW_PSP_RR
esxcli nmp device setpolicy --device naa.600507680181055b18000000000000f9 --psp VMW_PSP_RR
esxcli nmp device setpolicy --device naa.600507680181055b18000000000000fb --psp VMW_PSP_RR
~ #

Just a fastliner

interfaceips=$(ifconfig -a| grep "inet addr" | sed 's/\s\+/ /g;s/^\s\+//;s/^inet addr://' | cut -f1 -d" ")
for ip in $interfaceips
do
echo "scp $(whoami)@$ip:$(pwd)/$1"
done

2010/12/11

Cheapass Host Profile

Small project I am working on. It is java based, so you will need to install it (see the previous post on howto use the cheapass host profile on your vma)

Cheapass host profile isn't a full replacement for Host profile. Instead it allows you to create one xml with a lot of setting in it which you can the use to generate host specific configuration scripts. You can download the package from https://sites.google.com/site/tendertechie/home/chp.tar.gz?attredirects=0&d=1

When you download the tar you will need to extract it using the following command
tar -xzvf chp.tar.gz
This will create a subdirectory cheaphostprofile. Enter it by executing
cd cheaphostprofile


In the directory there a two important things. First of all the config.xml. This is an example xml of all possible "configurations" at this point. The xml is quite easy to understand. The other thing in the directory is the run script. If you run this command a script directory should be generated with a script for each esx host you specified and a runall script to run all the other scripts. Execute it by executing the following command
./run

In the backend, the cheaphostprofile is just a "wrapper" around fmpp. This is a template engine. The added value of cheaphostprofile is the preconfigured template for a script executable in a vMA. For more information about the fmpp, go to there website (lmgtfy). The template is under chp/src/autoconfig.cfg .