Linux Systems Articles for better insights

Xen Hints

Add local iso images SR

mkdir -p /var/opt/xen/iso_import/
xe sr-create name-label=ISO_IMAGES_LOCAL type=iso device-config:location=/var/opt/xen/iso_import/ device-config:legacy_mode=true content-type=iso host-uuid=ENTER SOMETHING HERE
wget https://buildlogs.centos.org/rolling/7/isos/x86_64/CentOS-7-x86_64-Minimal-1609-01.iso

Clone a VM

VM must be halted.

xe vm-clone new-name-label="New" vm="Original"

XenServer - Configure LACP Bonding: When you want to run your XenServer with interface trunking.

Determine UUIDs of interfaces to add

xe pif-list

Create new network (will return network UUID)

 network-create name-label=bond0

Create bonding (will return bonding UUID)

xe bond-create network-uuid=<network UUID> pif-uuids=<first pif UID>,<second pif UID>[,...]

Set bonding flags for bond0

xe pif-param-set uuid=<bond0 UUID> other-config:bond-mode=802.3ad
xe pif-param-set uuid=<bond0 UUID> other-config:bond-mode=lacp

Once your switch is configured check bond0 with

cat /proc/net/bonding/bond0

Also try

ovs-appctl bond/show bond0

Ensure guest auto start on boot:

ln -s /etc/xen/<instance> /etc/xen/auto/<instance>

Find out which IP a VM has:

# Grep and resolve MAC:
xm list -l <VM name> | grep mac
arp -a | grep -i <MAC address>

Add new storage

xe host-list                         # to get host UUID
xe sr-create host-uuid=<host UUID> shared=false type=lvm \
   content-type=user device-config:device=/dev/sdb1 name-label="Another disk"

XenServer - Restore VM from Image: Use "xe vm-import" to create a new VM with a new UUID:

xe vm-import filename=image.xva preserve=true