Tuesday, December 15, 2009

Citrix XenServer 5.5 command line (Storage issue)

The reality is that you can always do more from command line. Citrix XenCenter is very powerful however sometimes you are going to find issues that only can be resolved from command line.

I am going to show an example of a situation when you start to use command line.
First you have to understand that Citrix Xen defines each component with an uuid on its database. Each component on your system have an uuid
1- Host
2- VM
3- Storage
4- Pool and so on

Example:

[root@xenserver01 ~]#
[root@xenserver01 ~]# xe host-list
uuid ( RO) : d5003241-d252-4bc7-9485-2fa5838e09f3
name-label ( RW): xenserver01
name-description ( RO): Default install of XenServer

[root@xenserver01 ~]#


My problem: I took out one of the hard drive from xenserver01, I restart the server and Xencenter is showing my storage resource no available. I try to delete the SR however Xencenter is not allowing me to perform this operation. The resource stays red on my Xencenter console.

To resolve it, basically go command line and do the following:

[root@xenserver01 ~]# xe sr-list

This command will list all the SR you have on your system.

uuid ( RO) : 8311c845-beaf-b0ff-008a-2f03d256ebf5
name-label ( RW): Local Disk2
name-description ( RW):
host ( RO): xenserver01
type ( RO): lvm
content-type ( RO): user

Make sure you copy the uuid for the resource you want to work on. This case , we copy 8311c845-beaf-b0ff-008a-2f03d256ebf5 .

Then run the following command to delete it from Citrix Xen Database.

#xe sr-forget uuid= 8311c845-beaf-b0ff-008a-2f03d256ebf5

Now resource has been forgot from Citrix Xen database.

The same way you can use other commands so try :

#xe help --all

This command will show you all available command. Moreover, the xe command allows you to use TAB for auto completion .


No comments:

Post a Comment