Xenserver: fake xen tools for Solaris 10 guests

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

and

[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?

  1. Reboot: this does a clean reboot of the Solaris 10 domU
  2. 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.

Advertisements

Tags: , , ,

4 Responses to “Xenserver: fake xen tools for Solaris 10 guests”

  1. Dan Says:

    I know this post is old, but any luck figuring out the “Press any key to reboot” issue? I’m trying to run on KVM and am hitting the same issue no matter how I attempt to shut down (using the ACPI shut down method, using “sudo init 5”, using “sudo poweroff”, etc.). Right now I basically I just go through the normal steps and then force shut down the VM (through the hypervisor) when it tells me “Press any key to reboot”.

    • mperedim Says:

      Unfortunately no. “init 5” actually works on XenServer hence I simply made sure that everyone in my team was aware of it and used this instead.

      At some point in time I tried checking the relevant Opensolaris/Illumos code, see if I could come up with a dtrace hack to intercept a power-off-from-hypervisor event but I eventually gave up. Between lack of source code for Solaris 10, my mediocre dtrace skills and the actual business value of doing this (zero ;)) I gave up after a couple of days.

  2. Santosh Says:

    I am unable to find below location in Xenserver 6.2

    [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

    Please help.

    • mperedim Says:

      Unfortunately I no longer work with this setup. The only thing I can imagine is that “154” is not written in stone but actually depends on the domain id.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: