分类: 虚拟化
2011-12-08 12:40:30
If you do a clean install of XCP 1.0 or XCP 1.1 Beta you will find that after 30 days and a reboot none of your virtual machines will boot. If you are using XenCenter to manage your server you will see a notification that your license has expired. This is a bug in the current releases of XCP, and should be fixed in future releases. To fix the issue with a quick hack do the following:
Stop the XAPI service
/etc/init.d/xapi stop |
Edit the file /var/xapi/state.db and search for 'expiry'. The field should look something like this:
('expiry' '20110810T00:00:00Z') |
Change it so that it reads 30 days or more into the future.
('expiry' '20110910T00:00:00Z') |
Restart the XAPI service
/etc/init.d/xapi start |
You should be able to start all of your virtual machines again. You will need to perform this task again in 30 days until this check is removed from later releases of XCP.
Here is a small script that can be setup in cron to automate the task.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #!/bin/bash #Script to fix XCP 30 License expire issue #Script increases the month value by 1 #By: Ronny L. Bull & Alex Stuart #Version: 1.0 #Date: 8-9-2011 FUTURE=`date --date="next Month" '+%Y%m%d'` #stop xapi service /etc/init.d/xapi stop #Replace the expiry entry sed -i "s/\(expiry.\{3\}\)[0-9]\{8\}/\1$FUTURE/" /var/xapi/state.db #start xapi service /etc/init.d/xapi start |