Question
How can time be configured on XEN cloudboot hypervisors?
Environment
OnApp 3.x
XEN Cloudboot Hypervisors
Answer
* The examples below are for a Centos5 (used for XEN HVs) cloudboot HV
* Internet should be available on the HV
Important points:
- cloudboot HVs use BST(British Summer Time) time zone during boot
- hardware clock is read only once during the OS boot
- /etc/sysconfig/clock is absent on clouboot HVs so hardware clock is read as local time for BST time zone
- !!! all the listed above can't be changed by custom config !!!
#1 set hardware clock to current BST time:
- boot the HV
root@HV# /etc/init.d/ntpd stop root@HV# echo -e '79.142.192.4\t0.centos.pool.ntp.org' >> /etc/hosts root@HV# ntpdate 0.centos.pool.ntp.org root@HV# hwclock -w
#2 make CP timezone file available for the HV:
- check if /etc/localtime on CP is a regular file or a symlink
root@CP# ls -al /etc/localtime
-rw-r--r-- 1 root root 440 May 2 15:00 /etc/localtime
- copy the timezone file
root@CP# cp /etc/localtime
/tftpboot/images/centos5/diskless/snapshot/HW_MAC_ADDRESS/etc/localtime
#3 modify the HV custom config (in UI):
- add the following lines to the HV custom config
ln -sf /.rw/etc/localtime /etc/localtime echo -e '79.142.192.4\t0.centos.pool.ntp.org' >> /etc/hosts echo -e '193.192.36.3\t1.centos.pool.ntp.org' >> /etc/hosts echo -e '82.193.117.90\t2.centos.pool.ntp.org' >> /etc/hosts
#4 reboot the HV from UI.
If you don't want to set up the internet on these HVs, you can configure the ntpd service on the CP and modify 'ntp.conf' on the HVs via custom scripts to use the CP as the source. You should not need to add records to /etc/hosts in this case.
This is the setup your team will have to do, as it's not related to OnApp software, and we're restricted on setting up third party services.