Note: Also, you hopefully appreciate that this is completely unsupported.
Xenserver doesn’t enable Shutdown / Reboot buttons for VMs that don’t have the XenServer tools installed. This is an issue for my Solaris 10 guests since tools are not available for this platform. Which has been bugging me for some time.
So I went ahead and dug into the XenServer tools for linux. Turns out that the only thing they’re doing is updating a bunch of parameters on XenStore. However, Solaris 10 doesn’t have a device path for XenStore, putting us back into square one. Or not?
Not really. Turns out that Xen Tools installation is like
orgasm memory. Sure, it’s a lot better if one has them, but if not one can modify the appropriate XenStore parameters from dom0 and fake it. XenServer couldn’t care less how the parameters were modified, as long as they are tweaked in the proper order the Suspend/Reboot/Shutdown buttons are enabled. So just get the dom-id of your Solaris VM:
[root@dom0 log]# xe vm-list name-label=i-2-323-VM params=dom-id
dom-id ( RO) : 154
[root@dom0 log]# xenstore-write /local/domain/154/attr/PVAddons/Installed 1 [root@dom0 log]# xenstore-write /local/domain/154/attr/PVAddons/MajorVersion 6 [root@dom0 log]# xenstore-write /local/domain/154/attr/PVAddons/MinorVersion 1 [root@dom0 log]# xenstore-write /local/domain/154/attr/PVAddons/MicroVersion 0 [root@dom0 log]# xenstore-write /local/domain/154/attr/PVAddons/BuildVersion 59235 [root@dom0 log]# xenstore-write /local/domain/154/attr/PVAddons/os/class "SunOS" [root@dom0 log]# xenstore-write /local/domain/154/attr/PVAddons/os/major "5" [root@dom0 log]# xenstore-write /local/domain/154/attr/PVAddons/os/minor "10" [root@dom0 log]# xenstore-write /local/domain/154/data/updated 1
The above is enough to enable the shutdown/reboot/suspend buttons. Unfortunately in the process it also sets the “platform: viridian: true” parameter which doesn’t play nicely with Solaris VMs.
[root@dom0 log]# xe vm-list name-label=i-2-323-VM params=uuid uuid ( RO) : 5dc51848-bc9c-dd70-b670-2c7d263a7fe5 [root@dom0 log]# xe vm-param-remove param-name=platform param-key=viridian uuid=[...]
… and see the “Force shutdown”, “Force reboot” buttons disappearing.
So what works?
- Reboot: this does a clean reboot of the Solaris 10 domU
- Live migrate: not extensively tested, but a test VM does keep network connectivity after a single live migration.
Unfortunately shutdown only kind of works. Hitting the button does initiate a clean shutdown of the Solaris domU but the guest never seems to do an ACPI poweroff and gets stuck at “Press any key to reboot”. This is proving a slightly more touch nut to crack.
Update 2012/04/01: I’ve wasted a few too many hours on “shutdown” not working. Maybe I’ll revisit this in the future but calling it quits for now.