Xen Server - Cookbook
Repos for CentOS
Enable all the base repos for Centos
sudo sed -i -e "s/enabled=0/enabled=1/" /etc/yum.repos.d/CentOS-Base.repo
Temp sensor
Enable the above repository
yum install lm_sensors-devel.x86_64
modprobe coretemp
sensors-detect
sensors
Load the module on boot
echo modprobe coretemp >> /etc/rc.local
(nano /etc/rc.modules then add coretemp)
SNMP
cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org
echo "# LOCAL NETWORK CAN READ " > /etc/snmp/snmpd.conf
echo "rocommunity public 172.16.1.0/24" >> /etc/snmp/snmpd.conf
service snmpd restart
chkconfig snmpd on
Edit the iptables configuration and restart "service iptables restart"
nano /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m conntrack --ctstate NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -s 172.16.1.97 -p udp -m udp --dport 161 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
WAKE ON LAN
Linux wake on lan, sets the nic (eth0) for WOL enabled on boot using rc.local and ethtool.
echo '/usr/sbin/ethtool -s eth0 wol g' >> /etc/rc.d/rc.local
Virtual Disks stuck on Control domain
List VDIs to get the UUID of VDI
xe vdi-list name-label=" NAME "
You will want to list out the VBD (connector object between VM and VDI) based on the VDI UUID.
Note the UUID which is the Control domain (first line of the block which has the label/description)
xe vbd-list vdi-uuid=<UUID of VDI>
Once done, you want to first try to make VBD inactive (it may already be inactive),
xe vbd-unplug uuid=<UUID of VBD>
Once done, you can then break the connection:
xe vbd-destroy uuid=<UUID of VBD>
Enable all the base repos for Centos
sudo sed -i -e "s/enabled=0/enabled=1/" /etc/yum.repos.d/CentOS-Base.repo
Temp sensor
Enable the above repository
yum install lm_sensors-devel.x86_64
modprobe coretemp
sensors-detect
sensors
Load the module on boot
echo modprobe coretemp >> /etc/rc.local
(nano /etc/rc.modules then add coretemp)
SNMP
cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org
echo "# LOCAL NETWORK CAN READ " > /etc/snmp/snmpd.conf
echo "rocommunity public 172.16.1.0/24" >> /etc/snmp/snmpd.conf
service snmpd restart
chkconfig snmpd on
Edit the iptables configuration and restart "service iptables restart"
nano /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m conntrack --ctstate NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -s 172.16.1.97 -p udp -m udp --dport 161 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
WAKE ON LAN
Linux wake on lan, sets the nic (eth0) for WOL enabled on boot using rc.local and ethtool.
echo '/usr/sbin/ethtool -s eth0 wol g' >> /etc/rc.d/rc.local
Virtual Disks stuck on Control domain
List VDIs to get the UUID of VDI
xe vdi-list name-label=" NAME "
You will want to list out the VBD (connector object between VM and VDI) based on the VDI UUID.
Note the UUID which is the Control domain (first line of the block which has the label/description)
xe vbd-list vdi-uuid=<UUID of VDI>
Once done, you want to first try to make VBD inactive (it may already be inactive),
xe vbd-unplug uuid=<UUID of VBD>
Once done, you can then break the connection:
xe vbd-destroy uuid=<UUID of VBD>