Category Archives: XenServer

RAID1 Mdadm and XenServer (Notes)

Important thing to note: /dev/sda1: the XenServer root partition /dev/sda2: XenServer uses this partition for temporary space during upgrades /dev/sda3: your storage repository should be in this logical volume/dev/sda1: the XenServer root partition /dev/sda2: XenServer uses this partition for temporary space during upgrades /dev/sda3: your storage repository should be in this logical volume Show info […]

Install XenServer Tools on Linux VMs

Right-click on the VM and select “Install XenServer Tools”: On the opened window click on “Install XenServer Tools”: Login via SSH as root to your VM and mount the VM image: mount /dev/xvdd /mntmount /dev/xvdd /mnt Execute this script to install the SenSeerver Tools: /mnt/Linux/install.sh/mnt/Linux/install.sh Then reboot the VM: shutdown -r nowshutdown -r now More […]

Install Debian Jessie 8 on XenServer 6.5

To install Debian Jessie 8 on XenServer 6.5 we need first to create a template for Debian 8. To do so, login as root via SSH on the XenServer and create a file: vi debian8template.shvi debian8template.sh Add this content: #!/bin/bash ## Script to install a Debian Jessie 8 template on Xenserver 6.5 ## https://gist.github.com/jniltinho/0455fb5f01cfd8bbdbff ## […]

Delete a Template on XenServer

To delete a template on XenServer you can type: xe template-uninstall template-uuid=ENTER_TEMPLATE_UUID_HERE force=truexe template-uninstall template-uuid=ENTER_TEMPLATE_UUID_HERE force=true If it cannot be deleted due to these errors: The operation attempted is not valid for a template VM You cannot delete the specified default templateThe operation attempted is not valid for a template VM You cannot delete the […]

XenServer VM virtual disk could not be found

If with Xen Server 6.2 you get an error like this when you try to start a VM: Error: Starting VM ‘vm1’ – This operation cannot be performed because the specified virtual disk could not be foundError: Starting VM ‘vm1’ – This operation cannot be performed because the specified virtual disk could not be found […]

Add new NFS virtual disk storage to Virtual Machine (XenServer)

First you need to create a NFS Virtual Disk Storage via XenCenter. Then select a VM, open the “Storage” tab in XenCenter, and click the button “Add…”: Then you should see the virtual disk present in the list of virtual disks: The virtual disk is now attached and active in the virtual machine. Connect to […]

How to secure your XenServer with Iptables

We will allow only your IP address to connect on port 22, 80 and 443. Edit the iptables file located here: vi /etc/sysconfig/iptablesvi /etc/sysconfig/iptables Change these lines: -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT […]

Useful storage repository commands XenServer

Show what is available on the physical disks: pvdisplaypvdisplay Example output: — Physical volume — PV Name /dev/md3 VG Name VG_XenStorage-14d4c49b-a46c-3e9d-6102-6a531b2be7d9 PV Size 1.81 TB / not usable 7.19 MB Allocatable yes PE Size (KByte) 4096 Total PE 474880 Free PE 458883 Allocated PE 15997 PV UUID 1y7deB-2V4S-AQBN-TRlM-1cT4-3WD1-1LZNE5 — Physical volume — PV Name /dev/md3 […]

Create a new storage repository in XenServer

Use fdisk to know what is the disk available to create a storage repository: fdisk -lfdisk -l Find which device is your new local disk, example Disk /dev/md3: 1991.8 GB, 1991804649472 bytes 2 heads, 4 sectors/track, 486280432 cylinders Units = cylinders of 8 * 512 = 4096 bytesDisk /dev/md3: 1991.8 GB, 1991804649472 bytes 2 heads, […]

XenServer Automated Patcher (Bash)

This script will retrieve and apply all of the latest hotfixes for Citrix XenServer: xs_patcher – XenServer Automated Patcher I am copying the content of the script (xs_patcher.sh) here: #!/bin/bash ## xs_patcher ## detects xenserver version and applies the appropriate patches   HOSTID=`xe host-list –minimal` HOSTNAME=`hostname`   function get_xs_version { get_version=`cat /etc/redhat-release | awk -F’-‘ […]