Sunday, February 22, 2009

5h of my life spoilt due to hacking

In my last post I suggested to clone zones and instead of running sys-unconfig I hacked the script, so that only /etc/nodename gets modified.
The script worked very well... It took 10 seconds to clone a zone. But after I installed MySQL and the monitoring agent, I failed monitoring the instances in the Enterprise Monitor. After "only" 5 hours of testing and re-installing I discovered that the Enterprise Monitor identifies the host via its ssh hostid, that was generated during install. Unfortunately all my clones had the same ssh hostid, so Enterprise Manager was a little confused.
What did I learn from these five hours?
  1. I will never again hack scripts that are written by people much smarter than me (Solaris engineering in this case).
  2. I can install zones regularly with zoneadm -z zonename install and everything is fine.
  3. I can clone a zone (with the standard script!) zoneadm -z zonename clone template but then MySQL Agent will fail and needs a TRUNCATE mysql.inventory on the local database. (Look at the agent's log file.) After that, the cloned zone will be monitored correctly.

No comments:

Post a Comment