GUI Console
GUI Windows – Very stable and reliable: http://xenserver_ip
GUI UNIX – Very unstable, alpha: http://www.xensemaking.com/openxenmanager/
WEB UNIX – Also alpha: http://www.xensemaking.com/xenwebmanager/
Shell Console
xsconsole – Nice XenServer console
xentop – Just like xm top
xenmon.py – Useful for monitoring the performance Xen domains
Debian install (CLI)
—– Modify Debian template So we can use 10G disk by default
— List templates
xe template-list
— Set disk size
xe template-param-set uuid=<TEMPLATE-uuid> other-config:disks='<provision><disk device=”0″ size=”10769803776″ sr=”” bootable=”true” type=”system”/></provision>’
xe template-param-list uuid=<TEMPLATE-uuid>
— Set ram size
xe vm-memory-limits-set uuid=<TEMPLATE-uuid> static-min=1GiB static-max=5GiB dynamic-min=5GiB dynamic-max=5GiB
—- Create instance
— List templates and choose one
xe template-list
— Create VM from template
xe vm-install template=”Debian Lenny 5.0 (32-bit)” new-name-label=image-Debian5-Node01x sr-uuid=<sr-uuid>
— Disable VNC
xe vm-param-set uuid=<uuid-of-vm> other-config:disable_pv_vnc=1
— Setup Affinity
xe vm-param-set uuid=<vm-uuid> affinity=<xenserver-uuid>
— Change vm name lable
xe vm-param-set uuid=<vm-uuid> name-label=”New-name-label”
— List
xe vm-list
— Set repository for net-install
xe vm-param-set uuid=<uid> other-config:install-repository=ftp://ftp.ca.debian.org/debian
http://mirror.centos.org/centos/5.8/os/x86_64/
— Set parent bridge for new VM
xe network-list bridge=xenbr0 –minimal
— Create vif network interface for new VM
xe vif-create vm-uuid=<vm-uuid> network-uuid=<host-bridge-uuid> mac=random device=0
— Find “Guest installer interface”, this is temporary interface for net-install
xe network-list (find Guest installer network)
—
xe network-param-set uuid=<install-network-uuid> other-config:ip_begin=10.0.2.0 other-config:ip_end=10.0.2.255 other-config:netmask=255.255.255.0
— Make sure that your VM autostart on reboot
xe vm-param-set uuid=<vm-uuid> other-config:auto_poweron=true
— Finally start VM
xe vm-start uuid=<vm-uuid>
— How to attach TOOLS ISO
xe vdi-list params=all sm-config:xs-tools=true (Find ISO file with xentools)
xe vbd-list vm-uuid=<vm-uuid> params=vdi-uuid,vdi-name-label (See all disk images associated with this VM including labels)
xe cd-list
xe vm-cd-add vm=<vm-uuid> cd-name=”xs-tools.iso” device=3 (THIS IS ONLY FOR THE FIRST TIME)
xe vm-cd-eject vm=<vm-label>
xe vm-cd-insert cd-name=<name of ISO or CD> vm=<vm-label> (Every other time)
— How to create snapshot
xe vm-snapshot vm=<vm-uuid> new-name-label=”First-01″
xe snapshot-list
— How to uninstall VM
xe vm-uninstall uuid=<vm-uid>
lvremove <LV UUID>
VNC dom0 Ssh forwarding magic
ssh -L 5901:127.0.0.1:5901 -N -f -l root 10.0.2.45
vncviewer localhost:5901 (Install tightvnc from macports)
Console dom0 access
First disable VNC (For temp. solution just kill -9 pid)
xe vm-param-set uuid=<uuid-of-vm> other-config:disable_pv_vnc=1 (Reboot)
How to enable vnc?
xe vm-param-remove uuid=<vm-uuid> param-name=other-config param-key=disable_pv_vnc
– xe vm-list
– list_domains
or xe vm-list params=dom-id uuid=<uuid-of-vm> –minimal
/usr/lib/xen/bin/xenconsole 1
Usefull
xe sr-list
(all about vm)
xe template-param-list uuid=<TEMPLATE-uuid>
xe host-list params=memory-free (All hypervisor RAM)
xe vm-list uuid=<vm-uuid> params=all
xe network-list – List of all interfaces
xe network-param-list uuid=<uid> – Detail info
HOW to install XEN-TOOLS from CLI
From XenServer shell
(This is just for a first time, for inserting CDROM second time use example from XenServer HowTo, This example will create cd-device and insert disk)
xe vm-cd-add vm=<vm-uuid> cd-name=”xs-tools.iso” device=3
Login to VM
mkdir /mnt/cdrom
dmesg |grep xvd (It is the last one in this case xvdd)
mount /dev/xvdd /mnt/cdrom/
cd Linux
./install.sh
reboot
How to eject
After reboot go to XenServer and eject CD
xe vm-cd-eject vm=image-Debian5-Node01
You can check status from
1. xsconsole
2. Virtual Machines
3. VMs running on the host
If you see Memory Usage and Network IP you are good to go 🙂
Snapshots
xe vm-snapshot vm=<vm-label> new-name-label=<snapshot-label>
xe snapshot-list
xe snapshot-list snapshot-of=<vm uuid>
xe snapshot-export-to-template snapshot-uuid=<snapshot-uuid> filename=/mnt/nfs/export-example-1
xe snapshot-uninstall snapshot-uuid=<snapshot-uuid>
Reclaim unused Snapshot VDI space (After snapshot removal XenServer will keep snapshot LVM space since server thinks you will use “snapshots space” again in the future, this is default “feature” behaviour)
xe snapshot-list
xe snapshot-uninstall snapshot-uuid=<snapshot-uuid>
xe host-call-plugin host-uuid=<XENSERVER-UUID> plugin=coalesce-leaf fn=leaf-coalesce args:vm_uuid=<VM_UUID>
How to add GPG key do Debian 5 Machine
wget -q http://updates.vmd.citrix.com/XenServer/5.5.0/GPG-KEY -O- | apt-key add –
Add your comment