Check Poolmaster
in XenCenter, the top-of-the-list server in a pool is always the master -- the rest below are alll slaves.
To check the pool master, give the following command on the Xenserver CLI.
#more /etc/xensource/pool.conf
Xenserver ipmortant ports
27000 (license server port)
7279 (vendor daemon port)
8082 (lic administration console port)
Usefull scripts:
All about your Citrix Xen Host
IFS=$','
hostuuidlist=$(xe host-list params=uuid --minimal)
poolname=$(xe pool-list params=name-label --minimal)
echo Pool,Host,Description,Version,Edition,Address,CPU,RAM > $poolname-hostinfo.csv
for hostuuid in $hostuuidlist
do
hostname=$(xe host-list params=name-label uuid=$hostuuid --minimal)
hostcpu=$(xe host-cpu-info uuid=$hostuuid --minimal)
hostdescription=$(xe host-list params=name-description uuid=$hostuuid --minimal)
hostedition=$(xe host-list params=edition uuid=$hostuuid --minimal)
hostaddress=$(xe host-list params=address uuid=$hostuuid --minimal)
hostmemory=$(xe host-list params=memory-total uuid=$hostuuid --minimal)
hostversion=$(uname -r)
hostram=$((hostmemory/1024/1024/1024+1))
echo $poolname,$hostname,$hostdescription,$hostversion,$hostedition,$hostaddress,$hostcpu,$hostram
done >> $poolname-hostinfo.csv
save file as:checkhostinfo.sh
All about your VM's on Citrix Xen Servers
IFS=$','
vmuuidlist=$(xe vm-list params=uuid is-control-domain=false is-a-snapshot=false power-state=running --minimal)
poolname=$(xe pool-list params=name-label --minimal)
echo VMName,OS,Pool,Host,IP,vCPUs,RAM,Storage,Description > $poolname-vminfo.csv
for vmuuid in $vmuuidlist
do
vmname=$(xe vm-list params=name-label uuid=$vmuuid --minimal)
OS=$(xe vm-list params=os-version uuid=$vmuuid --minimal)
hostuuid=$(xe vm-list params=resident-on uuid=$vmuuid --minimal)
VIP=$(xe vm-list params=networks uuid=$vmuuid --minimal)
vmdescription=$(xe vm-list params=name-description uuid=$vmuuid --minimal)
hostname=$(xe host-list params=name-label uuid=$hostuuid --minimal)
vcpus=$(xe vm-list params=VCPUs-number uuid=$vmuuid --minimal)
ram=$(xe vm-list params=memory-static-max uuid=$vmuuid --minimal)
vdiuuidlist=$(xe vbd-list vm-uuid=$vmuuid type=Disk params=vdi-uuid --minimal)
for vdiuuid in $vdiuuidlist
do
vdisize=$(xe vdi-list uuid=$vdiuuid params=virtual-size --minimal)
totalsize=$((totalsize+vdisize))
done
totalsize=$((totalsize/1024/1024/1024))
vmram=$((ram/1024/1024/1024))
echo $vmname,$OS,$poolname,$hostname,$VIP,$vcpus,$vmram,$totalsize,$vmdescription
done >> $poolname-vminfo.csv
save file as:checkvminfo.sh
All about your Storage Info
IFS=$','
hostuuidlist=$(xe host-list params=uuid --minimal)
poolname=$(xe pool-list params=name-label --minimal)
storageuuidlist=$(xe sr-list type=lvmohba params=uuid --minimal)
echo Pool,Name,Type,SizeAvailable,SizeInUse > $poolname-storageinfo.csv
for storageuuid in $storageuuidlist
do
storagename=$(xe sr-list type=lvmohba params=name-label uuid=$storageuuid --minimal)
storagetype=$(xe sr-list type=lvmohba params=type uuid=$storageuuid --minimal)
storagesizeavailable=$(xe sr-list type=lvmohba params=physical-size uuid=$storageuuid --minimal)
storagesizeinuse=$(xe sr-list type=lvmohba params=physical-utilisation uuid=$storageuuid --minimal)
storagesizeinusegb=$((storagesizeinuse/1024/1024/1024))
storagesizeavailablegb=$((storagesizeavailable/1024/1024/1024))
echo $poolname,$storagename,$storagetype,$storagesizeavailablegb,$storagesizeinusegb
done >> $poolname-storageinfo.csv
storageuuidlist=$(xe sr-list type=lvmoiscsi params=uuid --minimal)
for storageuuid in $storageuuidlist
do
storagename=$(xe sr-list type=lvmoiscsi params=name-label uuid=$storageuuid --minimal)
storagetype=$(xe sr-list type=lvmoiscsi params=type uuid=$storageuuid --minimal)
storagesizeavailable=$(xe sr-list type=lvmoiscsi params=physical-size uuid=$storageuuid --minimal)
storagesizeinuse=$(xe sr-list type=lvmoiscsi params=physical-utilisation uuid=$storageuuid --minimal)
storagesizeinusegb=$((storagesizeinuse/1024/1024/1024))
storagesizeavailablegb=$((storagesizeavailable/1024/1024/1024))
echo $poolname,$storagename,$storagetype,$storagesizeavailablegb,$storagesizeinusegb
done >> $poolname-storageinfo.csv
storageuuidlist=$(xe sr-list type=nfs params=uuid --minimal)
for storageuuid in $storageuuidlist
do
storagename=$(xe sr-list type=nfs params=name-label uuid=$storageuuid --minimal)
storagetype=$(xe sr-list type=nfs params=type uuid=$storageuuid --minimal)
storagesizeavailable=$(xe sr-list type=nfs params=physical-size uuid=$storageuuid --minimal)
storagesizeinuse=$(xe sr-list type=nfs params=physical-utilisation uuid=$storageuuid --minimal)
storagesizeinusegb=$((storagesizeinuse/1024/1024/1024))
storagesizeavailablegb=$((storagesizeavailable/1024/1024/1024))
echo $poolname,$storagename,$storagetype,$storagesizeavailablegb,$storagesizeinusegb
done >> $poolname-storageinfo.csv
save file as:checkstorageinfo.sh
No Comments