This document provides instuctions for configuring a standalone VCL environment running on a single computer which is able to provision VCL reservations using VMware. It is only provided to help you understand how the various components of VCL operate. This document DOES NOT describe how to configure a production VCL environment. The environment described in this document can however be used to learn, test, and help develop VCL.
Begin by completing the installation instructions for the VCL components:
...
...
...
...
...
Panel |
---|
sudo bash |
Panel |
---|
yum groupremove "Virtualization" -y |
VMWare Server cannot be installed on a computer running a Xen kernel. To determine if a Xen kernel is being used:
Panel |
---|
uname -a |
Panel |
---|
Linux blade1g6-4 2.6.18-92.el5xen #1 SMP Tue Jun 10 19:20:18 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux |
Panel |
---|
yum update ecryptfs-utils -y |
Panel |
---|
less /boot/grub/grub.conf |
Panel |
---|
# grub.conf generated by anaconda |
Panel |
---|
# grub.conf generated by anaconda |
Panel |
---|
reboot |
Download the latest VMware Server 1.x RPM from http://www.vmware.com
(Note: these instructions assume you saved the RPM into /install)
Install the VMware Server RPM:
Panel |
---|
rpm -ivh /install/VMware-server-1.0.8-126538.i386.rpm |
Panel |
---|
vmware-config.pl |
Panel |
---|
yum install glibc-devel -y |
The following lists the sequence of answers to be entered after issuing the vmware-config.pl command:
Wiki Markup |
---|
In which directory do you want to install the mime type icons?
\[/usr/share/icons\] *ENTER* |
Wiki Markup |
---|
What directory contains your desktop menu entry files?
These files have a .desktop file extension. \[/usr/share/applications\] *ENTER* |
Wiki Markup |
---|
In which directory do you want to install the application's icon?
\[/usr/share/pixmaps\] *ENTER* |
Wiki Markup |
---|
None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? \[yes\] *ENTER* |
Wiki Markup |
---|
What is the location of the directory of C header files that match your running
kernel? \[/lib/modules/2.6.18-128.1.14.el5/build/include\] *ENTER* |
Wiki Markup |
---|
Do you want networking for your virtual machines? (yes/no/help) \[yes\] *ENTER* |
Wiki Markup |
---|
Your computer has multiple ethernet network interfaces available: eth0, eth1,
virbr0. Which one do you want to bridge to vmnet0? \[eth0\] *eth1* |
Wiki Markup |
---|
Do you wish to configure another bridged network? (yes/no) \[no\] *ENTER* |
Wiki Markup |
---|
Do you want to be able to use NAT networking in your virtual machines? (yes/no)
\[yes\] *no* |
Wiki Markup |
---|
Do you want to be able to use host-only networking in your virtual machines?
\[no\] *yes* |
Wiki Markup |
---|
Do you want this program to probe for an unused private subnet? (yes/no/help)
\[yes\] *no* |
Wiki Markup |
---|
Do you wish to configure another host-only network? (yes/no) \[no\] *ENTER* |
Wiki Markup |
---|
The default port : 902 is not free. We have selected a suitable alternative
port for VMware Server use. You may override this value now.
Remember to use this port when connecting to this server.
Please specify a port for remote console connections to use \[904\] *ENTER* |
Wiki Markup |
---|
In which directory do you want to keep your virtual machine files?
\[/var/lib/vmware/Virtual Machines\] *ENTER* |
Wiki Markup |
---|
The path "/var/lib/vmware/Virtual Machines" does not exist currently. This
program is going to create it, including needed parent directories. Is this
what you want? \[yes\] *ENTER* |
Verify the host-only network was configured correctly:
Panel |
---|
/sbin/ifconfig |
Panel |
---|
vmnet1 Link encap:Ethernet HWaddr 00:50:56:C0:00:01 |
Panel | ||
---|---|---|
|
Modify the /etc/hosts file to include entries for the VM host and guest computers:
Panel |
---|
vi /etc/hosts |
Panel |
---|
127.0.0.1 localhost |
Panel |
---|
vi /etc/ssh/sshd_config |
Panel |
---|
ListenAddress 192.168.0.1 |
Panel |
---|
/sbin/service sshd restart |
Add the VM host's public key to its own authorized_keys file to allow it to SSH to itself without a password prompt:
Panel |
---|
cat /etc/vcl/vcl.key.pub >> /root/.ssh/authorized_keys |
Panel |
---|
ssh localvmhost 'ls /' |
Configure the keys column in the managementnode table in the VCL database
Configure the vcld.conf file to use vcl.key:
Panel |
---|
vi /etc/vcl/vcld.conf |
Panel |
---|
IDENTITY_blade_linux=/etc/vcl/vcl.key |
Save a copy of the original dhcpd.conf file:
Panel |
---|
mv /etc/dhcpd.conf /etc/dhcpd.conf.orig |
Panel |
---|
vi /etc/dhcpd.conf |
No Format |
---|
ddns-update-style none; shared-network vmnet1 {
subnet 192.168.0.0 netmask 255.255.0.0 {
ignore unknown-clients;
option routers 192.168.0.1;
host vmguest-1 {
option host-name "vmguest-1";
hardware ethernet 00:50:56:1a:01:01;
fixed-address 192.168.1.1;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 192.168.0.1;
next-server 192.168.0.1;
}
}
}
|
The DHCP daemon should only listen on the virtual private network (vmnet1) to avoid conflicts with other production VCL networks. Configure the dhcpd service startup script to only listen on the vmnet1 interface:
Panel |
---|
vi /etc/init.d/dhcpd |
No Format |
---|
start() {
[ -x $dhcpd ] || return 5
[ -f $conf ] || return 6
pidofproc $prog >/dev/null 2>&1
RETVAL=$?
[ $RETVAL -eq 0 ] && return $RETVAL
echo -n $"Starting $prog: "
daemon $dhcpd vmnet1 $DHCPDARGS 2>/dev/null
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $lockfile
return $RETVAL
}
|
Configure the dhcpd service to automatically start at runlevels 3-5:
Panel |
---|
/sbin/chkconfig --level 345 dhcpd on |
...
The computer used to host the standalone VCL environment described in these instructions only needs a single network interface. These instructions will also work if it has multiple interfaces. The computer used to create these instructions had the following interfaces:
Tip |
---|
yum groupremove "Virtualization" -y |
VMWare Server cannot be installed on a computer running a Xen kernel. To determine if a Xen kernel is being used:
Tip |
---|
uname -a |
The following output indicates a Xen kernel is being used:
Panel |
---|
Linux blade1g6-4 2.6.18-92.el5xen #1 SMP Tue Jun 10 19:20:18 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux |
If "xen" appears in the output of the previous command, replace the Xen kernel:
Tip |
---|
yum update ecryptfs-utils -y |
Check the grub.conf file to make sure it is not configured to boot using the Xen Kernel
Tip |
---|
less /boot/grub/grub.conf |
The grub.conf file should NOT look like this:
Panel |
---|
title CentOS (2.6.18-92.el5xen) |
After removing the Xen kernel, reboot the computer:
Tip |
---|
reboot |
Download the latest VMware Server 2.0 RPM from http://www.vmware.com
Info |
---|
These instructions assume you saved the RPM into /root |
Tip |
---|
rpm -ivh /root/VMware-server-2.0.2-203138.x86_64.rpm |
Configure VMware Server:
Tip |
---|
vmware-config.pl |
Answer the questions asked by vmware-config.pl as follows:
Info | ||
---|---|---|
If you receive an error message when you execute vmware-config.pl you may need to install or update the following libraries and then run vmware-config.pl again:
|
Verify the host-only network was configured correctly:
Tip |
---|
/sbin/ifconfig |
You should see a vmnet1 interface using IP address 192.168.0.1:
Panel |
---|
vmnet1 Link encap:Ethernet HWaddr 00:50:56:C0:00:01 |
Tip |
---|
/sbin/service vmware restart |
You should see the following:
Panel |
---|
Starting VMware services: |
VMware Server 2.0 will not run reliably if the version of glibc installed on the host is newer than 2.5-34. This problem is known to affect recent versions of Red Hat Enterprise Linux and CentOS. If not corrected, VMware Server will crash intermittently and the VMware administration web pages will lock up or fail to load.
Check the version of glib installed on the VMware host:
Tip |
---|
yum list installed glibc |
You will need to configure VMware to use glibc 2.5-34 if the version installed on the host is newer than 2.5-34:
No Format |
---|
Installed Packages
glibc.i686 2.5-42 installed
glibc.x86_64 2.5-42 installed
|
For CentOS, you will need to download the glibc RPM included with CentOS 5.3. This is available from vault.centos.org:
Create a temp directory and cd to it:
Tip |
---|
mkdir /tmp/glibc ; cd /tmp/glibc |
Download the glibc RPM (change the URL accordingly):
Tip |
---|
wget http://vault.centos.org/5.3/updates/x86_64/RPMS/glibc-2.5-34.el5_3.1.x86_64.rpm |
Extract the cpio archive from the glibc RPM:
Tip |
---|
rpm2cpio glibc-2.5-34.el5_3.1.x86_64.rpm | cpio --extract --make-directories |
Create the following directory:
Tip |
---|
mkdir /usr/lib/vmware/lib/libc.so.6 |
Copy the following file to the new directory:
Tip |
---|
cp /tmp/glibc/lib64/libc-2.5.so /usr/lib/vmware/lib/libc.so.6/libc.so.6 |
Make a backup of the original vmware-hostd file:
Tip |
---|
cp /usr/sbin/vmware-hostd /root/vmware-hostd.orig |
Edit vmware-hostd:
Tip |
---|
vi /usr/sbin/vmware-hostd |
Navigate to the bottom of the file. You should see the following as the last line:
No Format |
---|
eval exec "$DEBUG_CMD" "$binary" "$@"
|
Add the following export line immediately before the last eval line in vmware-hostd:
No Format |
---|
export LD_LIBRARY_PATH=/usr/lib/vmware/lib/libc.so.6:$LD_LIBRARY_PATH
eval exec "$DEBUG_CMD" "$binary" "$@"
|
The following sed command can also be used to add the line to vmware-hostd:
Tip | ||
---|---|---|
sed -i -r -e "s/(eval exec.*)/export LD_LIBRARY_PATH=\/usr\/lib\/vmware\/lib\/libc.so.6:\$LD_LIBRARY_PATH\n\1/" /usr/sbin/vmware-hostd |
Restart the vmware service:
Tip |
---|
/sbin/service vmware restart |
At this point you should be able to log in as root to the VMware Infrastructure Web Access page:
*https://:8333*
Begin by completing the VCL installation instructions. Install all of the components on the same computer:
Note |
---|
Complete the Web Code Installation steps up to the Add a Management Node to the Database section. Use the instructions below to add the management node, VM host computer, and VM computers to the VCL database. |
Info |
---|
The computer Type and Provisioning engine values don't matter for the localvmhost computer in this test environment because vcld isn't provisioning or reloading it |
VMware Server installs its own DHCP service (vmnet-dhcpd). This service starts automatically when the vmware service is running. Either the VMware vmnet-dhcpd service or the normal dhcpd service installed on the Linux operating system can be used to assign IP addresses to the VMs' private interfaces. The instructions below explain how to disable vmnet-dhcpd and configure dhcpd.
Stop the vmware service:
Tip |
---|
/sbin/service vmware stop |
Edit the following file:
Tip |
---|
/etc/vmware/locations |
Find all lines beginning with answer VNET_1_DHCP yes and change yes to no:
Panel |
---|
answer VNET_1_DHCP no |
Start the vmware service:
Tip |
---|
/sbin/service vmware start |
Install dhcp if it is not already installed:
Tip |
---|
yum install dhcp -y |
The DHCP daemon should only listen on the virtual private network (vmnet1) to avoid conflicts with other networks. Configure the dhcpd service startup script to only listen on the vmnet1 interface:
Tip |
---|
vi /etc/sysconfig/dhcpd |
Add vmnet1 the to the DHCPDARGS line:
No Format |
---|
# Command line options here
DHCPDARGS=vmnet1
|
Configure the dhcpd service to automatically start at runlevels 3-5:
Tip |
---|
/sbin/chkconfig --level 345 dhcpd on |
Start the dhcpd service:
Tip |
---|
/sbin/service dhcpd start |
Tip |
---|
vi /etc/dhcpd.conf |
Info |
---|
The host sections below should be identical the the output displayed on the VCL website after you added the VM computers. |
No Format |
---|
ddns-update-style none; shared-network vmnet1 {
subnet 192.168.0.0 netmask 255.255.0.0 {
ignore unknown-clients;
option routers 192.168.0.1;
host vmguest-1 {
option host-name "vmguest-1";
hardware ethernet 00:50:56:1a:01:01;
fixed-address 192.168.1.1;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 127.0.0.1;
next-server 127.0.0.1;
}
host vmguest-2 {
option host-name "vmguest-2";
hardware ethernet 00:50:56:1a:01:03;
fixed-address 192.168.1.2;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 127.0.0.1;
next-server 127.0.0.1;
}
host vmguest-3 {
option host-name "vmguest-3";
hardware ethernet 00:50:56:1a:01:05;
fixed-address 192.168.1.3;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 127.0.0.1;
next-server 127.0.0.1;
}
host vmguest-4 {
option host-name "vmguest-4";
hardware ethernet 00:50:56:1a:01:07;
fixed-address 192.168.1.4;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 127.0.0.1;
next-server 127.0.0.1;
}
host vmguest-5 {
option host-name "vmguest-5";
hardware ethernet 00:50:56:1a:01:09;
fixed-address 192.168.1.5;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 127.0.0.1;
next-server 127.0.0.1;
}
host vmguest-6 {
option host-name "vmguest-6";
hardware ethernet 00:50:56:1a:01:0b;
fixed-address 192.168.1.6;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 127.0.0.1;
next-server 127.0.0.1;
}
host vmguest-7 {
option host-name "vmguest-7";
hardware ethernet 00:50:56:1a:01:0d;
fixed-address 192.168.1.7;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 127.0.0.1;
next-server 127.0.0.1;
}
host vmguest-8 {
option host-name "vmguest-8";
hardware ethernet 00:50:56:1a:01:0f;
fixed-address 192.168.1.8;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 127.0.0.1;
next-server 127.0.0.1;
}
host vmguest-9 {
option host-name "vmguest-9";
hardware ethernet 00:50:56:1a:01:11;
fixed-address 192.168.1.9;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 127.0.0.1;
next-server 127.0.0.1;
}
host vmguest-10 {
option host-name "vmguest-10";
hardware ethernet 00:50:56:1a:01:13;
fixed-address 192.168.1.10;
filename "/tftpboot/pxelinux.0";
option dhcp-server-identifier 127.0.0.1;
next-server 127.0.0.1;
}
|
Tip |
---|
/sbin/service dhcpd restart |
Tip |
---|
vi /etc/hosts |
Panel |
---|
192.168.0.1 localvmhost |
Tip |
---|
vi /etc/ssh/sshd_config |
Add the following line to the end of the file:
Tip |
---|
ListenAddress 192.168.0.1 |
Restart the sshd service on the management node:
Tip |
---|
/sbin/service sshd restart |
If you have not already generated an SSH identity key on the management node to be used to login to the computers the management node controls, run the following command to generate a new key:
Tip |
---|
mkdir /etc/vcl ; ssh-keygen -t rsa -f "/etc/vcl/vcl.key" -N '' -b 1024 -C "VCL root account on $HOSTNAME" |
Add the VM host's public key to its own authorized_keys file to allow it to SSH to itself without a password prompt:
Tip |
---|
cat /etc/vcl/vcl.key.pub >> /root/.ssh/authorized_keys |
The following command should execute without having to enter a password:
Tip |
---|
ssh -i /etc/vcl/vcl.key localvmhost 'ls /' |
Proceed to follow the instructions to create a Windows or Linux base image.