Convirt2 Installation
From ConVirt
Download, Install & Set Up ConVirt 2.0
Setting up the ConVirt 2.0 environment involves:
- Installing ConVirt Management Server (CMS) on at least one computer on in a virtual machine.
- Preparing each Managed Server to be managed by ConVirt.
- Using Firefox browser to access ConVirt and start managing your infrastructure.
Contents |
CMS Download and Installation
There are two ways of getting CMS up and running.
- Download a pre-packaged, configured appliance
- Follow the step by step instructions given to setup the CMS
Using Appliance with ConVirt 1.x
You can use this approach if you have a high speed internet connection and an already running virtualization environment that allows you to import disk images.
Prerequsites :
- ConVirt 1.1 environment with all patches applied. (Refer to Download and Patches)
- Good internet connection to download large virtual appliance image.
- 10 GB of hard disk space.
- VT enabled hardware to run HVM image.
Procedure :
- Start ConVirt 1.x
- Select and Image Group and invoke the Import Appliance menu.
- From the list select the ConVirt Appliance and Import it. Depending on your connection it will take few minutes to download the appliance.
- If you do not have access to the internet from the ConVirt 1.x workstation, then download the appliance disk separately from this location and follow the instructions outlined here.
- Now you should have ConVirt Appliance Image under the selected Image Group.
- Select the ConVirt Appliance Image and press Edit Settings and do the following changes.
- On the General Tab
- CPU = 2
- Memory = 512
- Move to the Miscellaneous tab and make the following changes.
- acpi = 1
- apci = 1
- network_mode = tap
- On the General Tab
- Select the ConVirt Appliance image and provision it.
- Start the appliance and go to its console window.
- Login as convirt/convirt. It is recommended to change the password.
- Change the directory to convirt and start CMS
cd ~/convirt ./convirt-ctl start
- Run the ifconfig eth0 command to find the IP assigned to it. For example,
sudo ifconfig eth0
- Start Firefox browser on other machine on the network and type in the url. http://ip-address:8081, The default credentials are admin/admin
- Visit ConVirt 2.0 patches page and follow instructions.
Using Appliance with Xen
You can use this approach if you have a high speed internet connection and an already running Xen virtualization environment
Prerequsites :
- Xen virtualization enabled Server
- Good internet connection to download large virtual appliance image.
- 10 GB of hard disk space.
- VT enabled hardware to run HVM image.
Procedure :
* Change the path in the disk parameter. * Change the bridge name in the vif entry
- Start the appliance using the config file name.
xm create convirt_appliance
- get the vnc port using the following command. Use xm list to get the DOMID of the appliance.
xenstore-read /local/domain/DOMID/console/vnc-port
- connect to the appliance using vncviewer and port obtained from previous command.
vncviewer :PORT_NO
Using Appliance with KVM
You can use this approach if you have a high speed internet connection and an already running KVM virtualization environment
Prerequsites :
- KVM virtualization enabled Server
- Good internet connection to download large virtual appliance image.
- 10 GB of hard disk space.
- VT enabled hardware to run HVM image.
Procedure :
- Download the appliance disk image here
- Start the appliance using the following command.(Change the path to the location where you downloaded the disk)
qemu-system-x86_64 -hda "/mnt/storage/vm_disks/c2_appliance.disk.xm" -net "nic,vlan=0,macaddr=00:16:3e:20:d4:44" -net "user,vlan=0" -std-vga "" -boot "c" -m "512" -vnc ":25" -name "convirt_appliance" -smp "2" -redir tcp:2222::22 -redir tcp:8888::8081 -daemonize
- Connect using vncviewer. In the above command port :25 is used.
vncviewer :25
Step by Step procedure
Either for the bandwidth reason or some other reason, if you wish to setup your CMS from scratch, follow instructions given below.
Fedora/RHEL/CentOS distribution
Firewall setup for VNC
In addition to CMS port (8081) as mentioned before, you should open up 6900:6999 port range for VNC. This is used by the ConVirt to allow VNC applet to access Virtual machine consoles. To do so,
- Login as root on the CMS server and run the following command.
iptables -I INPUT -m state --state NEW -p tcp --dport 6900:6999 -j ACCEPT
Apply Recommended patches
- Visit ConVirt 2.0 patches page and follow instructions.
Preparing Managed Servers
Before you start managing a remote server using ConVirt, you need to ensure that it's properly configured. This can be done easily in a few quick steps.
- Install (if necessary) and configure Xen (3.0.4 or higher) or KVM (kvm-70 or higher) on the managed server. Note: chances are your linux distribution already includes either Xen or KVM. Almost all modern distributions do.
- Here are some tips and pointers :
- For Xen on CentOS/RHEL : Select the Virtualization option at the time of installation.
- For Xen on SLES : Select Xen Virtual Machine Host Server option. Here is a good link. Novell Doc
- For KVM on Debian lenny/Ubuntu 8.10/9.04: apt-get install ssh kvm socat dnsmasq uml-utilities lvm2 should do the trick.
- Install required dependencies
- Here are few links that might be also be useful for finding dependencies. Dependencies, Virtualization KVM, KVM downloads
- For Xen and KVM ConVirt 2.0 requires
- * dnsmasq and tunctl utilities for managing virtual networks on the managed server. The tunctl utility comes in tunctl package on Fedora/CentOS/RHEL while is part of uml-utilities package on rest of the linux distributions.
- * socat is required for communicating to KVM console as well as for VNC. ( For rpms : rpm.pbone.net)
- * For SLES 11: you need to install bc util.
zypper in bc
- From your ConVirt workstation (the machine where you installed ConVirt), verify that you can log on to the managed server using ssh.
- Download the convirture-tools tar ball from:
http://www.convirture.com/downloads/convirture-tools/2.0/
- Extract the contents of the archive into a directory. For example:
tar -xzf convirture-tools-2.0.tar.gz
- Change to the <install_dir>/convirture-tools/install/managed_server/scripts directory, then use the convirt-tool command to check or configure the managed server. You will need to login as root user.
For example:
cd ./convirture-tools/install/managed_server/scripts
- To view the usage message, run:
./convirt-tool -h
- To validate the platform without making any changes, run:
./convirt-tool --detect_only setup
- To configure the server, run:
./convirt-tool setup
NOTE : If you already have your bridges or have complex bond setup, consider using --skip_bridge_setup option.
- For the Xen platform, running this command configures the Xend Server to listen on port 8006 and opens port 8002 for migration. The command also detects the default bridge and writes a summary of its operations to the /var/cache/convirt/server_info file.
- For the KVM platform, the command detects the bridge and writes a summary of its operations to the /var/cache/convirt/server_info file. The convirt-tool version 2.0 also creates public bridge for KVM.
- If you are using a firewall on Debian/Ubuntu you should verify that TCP port 8002 is open to allow migration (for both KVM and Xen), and TCP port 8006 is open in case of Xen to allow ConVirt to talk to the xend server.
Using ConVirt to manage your environment
Once the CMS and the managed servers are prepared,
- Typical CMS startup
- * Start the CMS
cd ~/convirt
./convirt-ctl start
- NOTE You would be prompted for passphrase if you have done ssh key based setup. By default the ~/.ssh/cms_id_rsa identity is used, if not found, it would use ~/.ssh/id_rsa. If neither of these are found, ConVirt would use passwords.
- Point the browser to CMS http://ip-address:8081/
- Login using credentials (default admin/admin)
- Select the Server Pool to which you'd like to add the new managed server. For example : QA Pool
- Right mouse click to get to the context menu and select 'Add Server'.
- Select the virtualization platform.
- Provide the IP address or hostname of the managed server prepared in the previous section. Also provide ssh credentials and check the "Use Keys" option in the advanced section. Press ok to add the server.
The new managed server would show up under the Server Pool. Now you can use ConVirt to create and manage complete life cycle of Virtual Machines on this server. Refer to documentation for more details.
You may want to do additional steps to further customize/setup your environment.
VNC setup
- To see the Graphic console of a Virtual Machine from the browser, you need to do some extra steps.
- Install Java Plugin in to the browser. This is required to run the VNC applet.
- ConVirt allows you to designate a host as VNC proxy, i.e. all VNC connections would be forwarded to this host and made accessible to the browser. The default VNC proxy is same host as the CMS. We will assume this for rest of the setup procedure.
- * Login to the CMS host as the linux user that starts the CMS ( ./convirt-ctl start)
- * As a part of the CMS setup, a ~/.ssh/cms_id_rsa and cms_id_rsa.pub files are already generated.
- * Now from the CMS host, try logging in to management server using the key setup. Enter the passphrase that was used at the time of CMS installation. (typically none)
eval `ssh-agent -s`
ssh-add ~/.ssh/cms_id_rsa
- * Now you should be able to login to any managed server for which the keys were setup without requiring password.
ssh root@managed-server
- This should work most of the time, if you entered credentials as well as checked the "Use Keys" options while adding the managed server. ConVirt automatically adds a cms_id_rsa to authorized host of the managed server. If for some reason, this does not work, you need to copy ~/.ssh/cms_id_rsa.pub on to EACH managed server and append it to ~/.ssh/authorized_keys file.
scp ~/.ssh/cms_id_rsa.pub root@managed-server:/root/.ssh/vnc_proxy_id_rsa.pub
ssh root@managed-server
cat ~/.ssh/vnc_proxy_id_rsa.pub >> ~/.ssh/authorized_keys
- Change the Firewall to allow TCP traffic on port range 6900-6999. This port range is used by the ConVirt to allow VNC applet to access Virtual machine consoles. Login as root on the CMS server and run the following command.
iptables -I INPUT -m state --state NEW -p tcp --dport 6900:6999 -j ACCEPT
- Please checkout this page that explains how VNC setup works. This might help troubleshoot VNC problems.
Setting up SSL for CMS
To setup SSL for CMS follow the links here.
Fedora/RHEL/CentOS distribution
NOTE : There is a known issues of login and logout redirects going to the non-http url causing error.
