Starting and stopping XenServer with the xe command

XenCenter shut down server

XenCenter shut down server

I run XenCenter for managing my XenServer in a virtual Windows7 system hosted on the XenServer itself.

This gives a bit of a catch 22 when it comes to shutting the system down.

As it turns out it does not work.

So what are my options?
From the top of my head I can think of a couple..

* hook up a monitor and keyboard to the server.
– Not interested.

* shut down using xsconsole via ssh.
– No, since I use a mac and you need to press f8 to verify the shut down command.

There is however a wonderful command called xe which you can use to manage just about all aspects of your XenServer.
So I shut down my management vm (the one with XenCenter) and get busy using xe:
[root@localhost ~]# xe host-disable
[root@localhost ~]# xe host-shutdown

Done! Give it a moment and the system powers off.

If you try to run host-shutdown without disable first you will be told to think again:
[root@localhost ~]# xe host-shutdown
This operation cannot be performed because the host is not disabled. Please disable the host and then try again.

The next time I am to user the server I power up and log in via ssh and run another couple of xe commands:
[root@localhost ~]# xe host-enable
[root@localhost ~]# xe vm-start vm=Windows\ 7\ \(64-bit\)\ \(1\)

Back in business!


Leave a Reply

Your email address will not be published. Required fields are marked *