Forcibly Remove a Host From XenCenter via CLI

PicklePD3Welcome back to another XenServer adventure. Today we are going to review the process of removing an orphaned XenServer host from XenCenter via the command line.

A few days ago one of my Xen hosts died due to an issue with the raid controller. In order to revive it I had to rebuild it, and add it back into the pool. However there was a problem; the original entry for this host in XenCenter appeared in red, which indicated that it was disconnected, and another entry for the same exact host with the same exact hostname appeared next to it in the host list for this particular cluster. I was unable to remove the orphaned host via XenCenter as there was no remove option.

I was in a pickle.

However I was able to find a solution.

First and formost it appears that there are actually two ways to do this; the first one being from the Windows command line where you are running Xencenter, or on the master node in the cluster.

This example is from the Windows CLI. Note that the UUID that is output to the command line is the UUID of the Host that is unreachable — the orphaned host.


C:\Program Files\Citrix\XenCenter>xe -s <Hostname_of_master> -u root -pw <root_password> pool-sync-database
You attempted an operation which involves a host which could not be contacted.
host: 560e233b-0e8b-4c2f-a641-cf1876630a6b (virt04.atlc1)

C:\Program Files\Citrix\XenCenter>xe -s <Hostname_of_master> -u root -pw <root_password> host-foget uuid=560e233b-0e8b-4c2f-a641-cf1876630a6b
WARNING: A host should only be forgotten if it is physically unrecoverable;
WARNING: if possible, Hosts should be 'ejected' from the Pool instead.
WARNING: Once a host has been forgotten it will have to be re-installed.
WARNING: This operation is irreversible.
Type 'yes' to continue
yes

Returning to XenCenter I found that the orphaned host entry had been removed.

 

Reset HP ILO Via the Command Line

Gary_the_snail Its not unheard of that an HP ILO (Integrated Lights Out) can become sick and slow down to a crawl. When this occurs, a restart of the ILO is in order, which is easily accomplished via the ILO cli interface. Note that you need to make sure that that you have enabled ssh access in ilo.

The steps to reset an ilo via ssh are below.

</>hpiLO-> cd /map1
status=0
status_tag=COMMAND COMPLETED

</map1>hpiLO-> reset
status=0
status_tag=COMMAND COMPLETED
Resetting iLO.

CLI session stopped

Additional Resources:

http://fatmin.com/2011/06/13/redirect-linux-console-to-hp-ilo-via-ssh/

http://www.thevirtualway.it/en/?p=985

http://setaoffice.com/2010/07/17/connecting-to-hp-ilo-using-the-command-line/

Getting Started with the VMware Management Assistant

Vmware_computer_logo_100x100I've seen a lot of blog posts as of late regarding the death of the Service Console (COS). The rumors are that ESX is going to be replace completely with ESXi. While most Widows/Vmware Admins probably don't care, us Linux/Vmware admins are less than happy as we want nothing to do with the Windows PowerShell.

So I did some poking around and ran into the Vmware Management Assistant, which is a tiny VM. Here is the official spiel from Vmware

"The vSphere Management Assistant (vMA) allows administrators and
developers to run scripts and agents to manage
ESX/ESXi and vCenter Server systems. vMA is a virtual machine that
includes prepackaged software, a logging
component, and an authentication component that supports non-interactive
login."

You can download and install it here

Documentation is here.
Basically the VMA give you a remote server that you can use to run commands against your ESX and ESXi boxes.

You can add a server to your list of managed servers with the command below. You will be prompted for your login credentials.Complete this step for all ESX and ESXi boxes.

sudo vifp addserver <servername>

To view your list type

vifp listservers

Then you can run a command against the boxes in your list, see below

vicfg-nics –server –<servername> –list 

You can also choose an execution server to run multiple commands against using the following

vifpinit <servername>

There is a lot more to the VMA, but this tip of the iceberg will get you started.