This is an old revision of the document!
http://www.citrix.com/xenserver
XenServer is a bare-metal hypervisor, available for free, that is similar to VMware ESXi.
Requires Windows to run the XenCenter management tool.
Quick Installation Guide:
http://www.citrix.com/site/resources/dynamic/salesdocs/XenServer_Quick_Installation_Guide.pdf
Other documentation:
http://updates.xensource.com/XenServer/6.0.0/XenCenter?pool_6.0.0=1
wget http://support.citrix.com/servlet/KbServlet/download/28993-102-680294/XS60E001.zip wget http://support.citrix.com/servlet/KbServlet/download/29185-102-680311/XS60E002.zip wget http://support.citrix.com/servlet/KbServlet/download/29609-102-680420/XS60E003.zip wget http://support.citrix.com/servlet/KbServlet/download/29484-102-680350/XS60E004.zip
OpenXenManager is a graphical interface to manage XenServer / Xen Cloud Platform (XCP) hosts through the network. OpenXenManager is an open-source multiplatform clone of XenCenter (Citrix).
sudo apt-get install subversion python-glade2 python-gtk-vnc cd ~/bin/ svn co https://openxenmanager.svn.sourceforge.net/svnroot/openxenmanager openxenmanager
Launcher command:
python /home/gcooper/bin/openxenmanager/window.py
CIFS → Centos CIFS ISO library → \\192.168.0.6\nas_vg_1.nas_vol_1.no_backup\Centos
Set username and password.
You can't set folders using NFS, only shares, so .iso files must be in the top-level folder with NFS:xe appliance-start uuid=[uuid-vapp]
No_Backup NFS ISO library → 192.168.0.6:/mnt/nas_vg_1/nas_vol_1/no_backup
Note that this will probably break and have to be fixed after a version upgrade!
mkdir -p /var/opt/xen/iso_library xe sr-create name-label ="ISO Repository" type=iso device-config:location=/var/opt/xen/iso_library/ device-config:legacy_mode=true content-type=iso
You may have to give the new SR a name in XenCenter.
I suspect you would need to recreate the directory and recopy the ISO files to repair after upgrading your XenServer.
Start with 5.4 32-bit template and use mostly defaults.
Install from URL:
http://mirrors.easynews.com/linux/centos/5.5/os/i386/
http://mirrors.easynews.com/linux/centos/5.5/os/x86_64/
Do NOT start the VM automatically.
Adjust the Description and Storage Name and Storage Description as needed.
Start the VM - be patient because some large files are transferred over the 'net.
URL:
http://mirrors.easynews.com/linux/debian/
then:
debian.mirrors.easynews.com
apt-get install openssh-server
URL:
http://distro.ibiblio.org/pub/linux/distributions/smeserver/releases/testing/8.0beta6/smeos/i386/
In XenCenter, select xs-tools.iso for the DVD drive.
mount /dev/xvdd /mnt cd /mnt/Linux
bash install.sh wget -q http://updates.vmd.citrix.com/XenServer/5.6.0/GPG-KEY -O- | apt-key add - /etc/init.d/xe-linux-distribution start
mv /etc/redhat-release /etc/redhat-release-sme echo "CentOS release 5 (Final)" > /etc/redhat-release /etc/init.d/xe-linux-distribution start ln -s /etc/rc.d/init.d/xe-linux-distribution /etc/rc7.d/S26xe-linux-distribution
xe vm-disk-list vm= < name of the VM >
xe vm-list xe vm-param-set HVM-boot-policy="BIOS order" uuid=UUID of VM
Next, on the “General” tab, select the “Edit” button. On the “Startup Options” tab, ensure that “DVD-Drive” is moved to the top.
Before starting VM, make sure that the ISO that you want is in the VM's DVD-Drive located on the “Console” tab.
Proceed to use SUSE CD-ROM (or DVD) to upgrade, or Linux Rescue media, etc. Once all changes have been made to the VM, you will need to revert back the change to the VM's parameter with the following command:
xe vm-param-set HVM-boot-policy=“” uuid=UUID of VM
Reboot VM
Final caveat… mouse is unavailable as it is “HVM mode” and no device has been loaded.
See XenServer Backup.
http://forums.citrix.com/message.jspa?messageID=1367138
* Bonded NICs * Separate network paths for * VMs * Storage * Management * 6 NICs per server! * SAN/NAS storage
XenCenter - Port 443
http://66.165.176.77/servlet/KbServlet/download/2389-102-647335/Citrix_TCP_Ports_0167.pdf
iptables -nL -v --line-numbers
iptables -I RH-Firewall-1-INPUT 13 -p udp --dport 123 -j ACCEPT service iptables save
This sample firewall allows NTP and limits access to ports 22, 80 and 443 by the sourde IP.
/etc/sysconfig/iptables
# Generated by iptables-save v1.3.5 on Mon Apr 9 00:15:34 2012 *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [135:25337] :RH-Firewall-1-INPUT - [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A RH-Firewall-1-INPUT -i lo -j ACCEPT -A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT -A RH-Firewall-1-INPUT -p esp -j ACCEPT -A RH-Firewall-1-INPUT -p ah -j ACCEPT -A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT -A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT -A RH-Firewall-1-INPUT -i xenapi -p udp -m udp --dport 67 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 694 -j ACCEPT -A RH-Firewall-1-INPUT -s 209.104.9.32/255.255.255.240 -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -s 209.193.64.248/255.255.255.248 -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -s 72.200.111.140 -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -s 209.193.64.2 -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -s 209.104.9.32/255.255.255.240 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A RH-Firewall-1-INPUT -s 209.193.64.248/255.255.255.248 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A RH-Firewall-1-INPUT -s 72.200.111.140 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A RH-Firewall-1-INPUT -s 209.193.64.2 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A RH-Firewall-1-INPUT -p udp -m udp --dport 123 -j ACCEPT -A RH-Firewall-1-INPUT -s 209.104.9.32/255.255.255.240 -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT -A RH-Firewall-1-INPUT -s 209.193.64.248/255.255.255.248 -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT -A RH-Firewall-1-INPUT -s 72.200.111.140 -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT -A RH-Firewall-1-INPUT -s 209.193.64.2 -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited COMMIT # Completed on Mon Apr 9 00:15:34 2012
http://www.virtues.it/2012/01/howto-autostart-xs-vapp/
xe appliance-list xe appliance-list <vm-name>
Add this line to /etc/rc.local:
xe appliance-start uuid=[uuid-vapp]
Assumes:
1. Running LVM in the guest (you can do this without it, but it's difficult). 2. You're using a filesystem such as Ext3 on the partition you wish to expand which supports online expansion. 3. You're able to perform a backup just in case something goes wrong.
Steps:
5-11. Run pvresize /dev/xvdX“ (replacing “X” with the disk identified in step 4). 1. Shut down the virtual machine from XenCenter.
2. Resize the VDI from XenCenter to the appropriate size
3. Start the VM up.
4. Run “fdisk -l” to locate the virtual disk by looking at the size.
5. Run “fdisk /dev/xvdX” (replacing “X” with the disk identified in step 4).
6. Create a new partition (usually primary) using all available space. The default options will be sufficient. To do this, type “n”, follow the instructions to create the partition, then type “p” to verify the changes and then “w” to write and then “q” to quit.
7. Reboot the VM again to allow udev to create the appropriate /dev/ node for the partition just created.
8. Create a new physical volume by running “pvcreate /dev/xvdXY” (replacing “X” with the disk identified in step 4).
9. Locate the Volume Group containing the partition by running “mount”. Look for the partition you wish to resize in the list. You should also see a reference to the Volume Group (e.g. “VolGroup00”) and the Logical Volume (e.g. “LogVol00”) take note of these two items.
10. Extend your Volume Group with the newly added Physical Volume by running vgextend as shown: “vgextend VolGroupXX /dev/xvdXY” (Replace “VolGroupXX” with the Volume Group as identified in step 9, and ”/dev/xvdXY“ as identified in steps 4 and 6).
11. Confirm the Volume Group has free storage by running “vgs”. This should indicate the total size and the amount of storage free for allocation to logical volumes.
12. Expand the Logical Volume using all available free extents by running: lvextend -l+100%FREE /dev/VolGroupXX/LogVolYY Remember to change VolGroupXX and LogVolYY as appropriate.
13. Assuming ext3 or ext2 is being used (other filesystems will have their own tools for this purpose), resize the filesystem by running: resize2fs /dev/VolGroupXX/LogVolYY
14. As a precaution, reboot the system again checking the filesystem for errors: shutdown -r now -F
15. Observe the output of the “fsck” execution during startup and monitor for any errors that may indicate corruption.
When you install Redhat on XenServer it does not by default enable a virtual video device. You are only given the text console by default.
Citrix's Virtual Machine Installation Guide does document how to enable the typical X console using VNC.
Check to make sure that vnc-server and gdm are installed.
rpm -q vnc-server gdm
If they are not, install them.
yum install vnc-server gdm
Modify /etc/gdm/custom.conf
so the default server is a VNC server:
[servers] 0=VNC [server-VNC] name=VNC Server command=/usr/bin/Xvnc -SecurityTypes None -geometry 1024x768 -depth 16 -BlacklistTimeout 0 flexible=true
When GDM is running it should be listening on port 5900. Make sure that the iptables firewall allows access to this port from any machine running XenCenter or wanting to connect.
iptables -N vnc iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 5900 -j vnc iptables -A vnc -s 134.114.0.0/255.255.0.0 -p tcp -m state --state NEW -m tcp --dport 5900 -j ACCEPT iptables -A vnc -p tcp -m tcp -m state --state NEW --dport 5900 -j REJECT
Now everything is set up, but by default Redhat on XenServer starts up into runlevel 3. This does not by default start GDM. So you can modify the default runlevel in /etc/inittab or as I would recommend, simply use telinit 5 to start it and telinit 3 to turn it off. This saves memory and CPU cycles.