Thursday, January 10, 2013

Installing vCloud Director on CentOS and MS SQL Express - part 2

This is part 2 of a 3 part post that presents installation of vCloud Director 5.1 on CentOS 6.3 and MySQL Server 2012 Express
  • part 1 presents Configuration of MS SQL 2012 Express Database for vCloud Director installation
  • part 2 presents Configuration of CentOS 6.3 for vCloud Director
  • part 3 presents Installation of vCloud Director 5.1

Configuration of CentOS 6.3 for vCloud Director

The media kit used for this installation is Cent OS 6.3 64 bit minimal release (CentOS-6.3-x86_64-minimal.iso). My first vCD install was on Cent OS Live CD release, on which I spent too much time to deactivate Network Manager, configure a simple IP alias, change the init level and so on. That`s why this one is Cent OS minimal.
Before starting any configuration check that you have access to a local/remote Cent OS repository and that you have downloaded Java Runtime Environment 32 bit minimal 1.6 update 10. It is a 32 bit JRE, as it is the only version supported by VMware. I have used version 1.6 update 38 ( jre-6u38-linux-i586-rpm.bin)downloaded from Oracle`s site.
Create the VM for CentOS: 1 vCPU, 2 GB RAM (VMware recommended size), 10 GB HDD thin provisioned, 1 Gigabit interface. vCloud Director requires minimum 2 IP addresses - one for portal and one for remote console. However, the addresses can be configured on the same interface in the same subnet (alias) - this is my case. If your network setup is different, then configure 2 interfaces.
Next, open the console of the VM, power on the VM, connect the cdrom to CentOS iso and start installing the OS. During the install modify the default partitioning in the following way: reduce lv_swap to 1024 GB and increase lv_root to maximum (almost 9GB). For the rest of the install, follow defaults.
After the system has been installed, it is time to start the preparation for vCD installation. First thing first... configure the network interfaces and DNS  (we need network connectivity in order to install other packages such as perl):
  • configure eht0 and eth0:0 interfaces
[root@vcd5101 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
IPADDR="192.168.X.X"
NETMASK="255.255.255.0"

[root@vcd5101 ~]# cp -p /etc/sysconfig/network-scripts/ifcfg-
eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
[root@vcd5101 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE="eth0:0"
BOOTPROTO="static"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
IPADDR="192.168.X.X"
NETMASK="255.255.255.0"

  • configure default gateway and restart the network service
[root@vcd5101 ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=vcd5101
GATEWAY=192.168.X.X
[root@vcd5101 ~]# service network restart

  • configure DNS (my lab domain is cr.vmlab)
[root@vcd5101 ~]# vi /etc/resolv.conf
nameserver 192.168.X.X
domain cr.vmlab
[root@vcd5101 ~]# vi /etc/hosts
192.168.X.X vcd5101 vcd5101.cr.vmlab
Test connectivity to both IP addresses, DNS servers and gateway. Next we need to prepare the system for VMware tools installation. Being a minimal Cent OS we have to install perl:
[root@vcd5101 ~]# yum install perl
Perl is needed for our next step, VMware tools installation. In vSphere client choose Install/upgrade tools, open the console, mount the cdrom and install the tools:
[root@vcd5101 ~]# mount /dev/cdrom /media/[root@vcd5101 ~]# tar -zxvf /media/VMwareTools-9.0.0-782409.tar.gz
[root@vcd5101 ~]# ./vmware-tools-distrib/vmware-install.pl
During the configuration, chose default values. At the end, unmount the cdrom:
[root@vcd5101 ~]# umount /media/
Since the version used is minimal, there are some dependencies to be fulfilled.  The list of packages can be found in the official VMware documentation - I got mine from vCloud Director course manual. Run the following command, while -y will take care of the long list of dependencies: 
[root@vcd5101 ~]# yum install -y alsa-lib libICE libSM libX11 libXau libXext libXi libXt libXtst redhat-lsb
Side thought - while deploying on Cent OS Live CD installation, the only missing package is redhat-lsb.
The last package needed is JRE. Transfer JRE rpm to the system and install it:
[root@vcd5101 ~]# yum install ld-linux.so.2
[root@vcd5101 ~]# chmod u+x jre-6u38-linux-i586-rpm.bin
[root@vcd5101 ~]#./jre-6u38-linux-i586-rpm.bin

Running the bin will extract the rpm and also install jre. When installation is finished with the message "Done" it is time to start vCloud Director installation - part 3.

UPDATE 11.01.2012 - Iptables
By default, CentOS comes with iptables enabled. It is a good practice to keep the firewall on. I have configured the following ports (based on VMware documentation). However, it is possible to need new rules and the post will be updated accordingly.
[root@vcd5101 ~]# vi /etc/sysconfig/iptables
# vCloud Director Ports
# vCloud HTTPS
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
# NFS
-A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 920 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 920 -j ACCEPT
#ActiveMQ
-A INPUT -m state --state NEW -m tcp -p tcp --dport 61611 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 61616 -j ACCEPT
#Syslog
-A INPUT -m state --state NEW -m udp -p udp --dport 514 -j ACCEPT
[root@vcd5101 ~]# service iptables restart

4 comments:

Viktor said...

Thanks! Helpt me a lot!

MCT Peluffo said...
This comment has been removed by the author.
MCT Peluffo said...

Hello,

Good article... I am installing vcloud and following this article...

I would like to say that my installation asked me about libXdmcp and pciutils as prereq...

Maybe it is a requirement for vcloud 5.1.3

thanks

Nicole kristen said...

It was an excellent article to hear from you which is very useful. Thank you for sharing. Here i found how to install vCloud Director on CentOS and MS SQL Express. We also offer efficient yet affordable Online vmware vcloud director Training with quality as the main objective.