Welcome to Delicate template
Just another WordPress site

XenServer VM Autostart

junio 12th, 2012 | Posted by cristiansan in CLI | XenServer - (0 Comments)

For check if the VM on XenServer have Auto-run configured, do this…

Check your VM List with this instruction:

# xe vm-list


Two years ago I spoke in Citrix GeekSpealk Local in Barcelona about tools and some tips for XenServer.

As you know, XenServer is based on CentOS Linux. As a good Linux, XenServer have a online repository for software and you can actívate this , for download aditional software for análisis and troubleshooting. Or other packages as a FTP Server… you know.

Important: This change is not supported by Citrix. Any aditional service installed on server can cause poor performance and system crashes.

Ops, this is dangerous! But, it can help-me to analyce the server with some tools very interesting on Linux world.

How can I activate the repositoty?

This is a easy step that you can see in continuation:

Logon to XenServer console or through ssh client, and do:

 #cd /etc/yum.d.repo

 Here, we have the repo file.

 Citrix.repo <- Software Citrix Repository for XenServer updates

CentOS-Media.repo <- CD CentOS Repository

CentOS-Base.repo.orig <- Orginal Repository CentOS OS.

CentOS-Bae.repo <- Repository CentOS for edit .

If you edit this file, you can see that CentOS URL are commented with # and disabled. You can edit this file with text editor as VI and delete this # for activate the CentOS repositori and change the value of “enabled” from 0 to 1.

I active all repositoris on CentOS-Base except updates.

Be Carefull! One update in system and is posible that you need reinstall the server complete.

Now, it’s the momento for use “yum”

Firstly you need to upgrade the repository index. Type:

# yum upgrade

This is a upgrade without CentOS repos active:

After modify the repo file, and upgrade the server you can see this:

When finish the upgrade the repo list type NO INSTALL updates.

And now, is the momento to find now software for Troubleshoting our XenServer enviroments.

You can type:

# yum search ip <- search all packets that content the ip stream.

If you know the packet is moment the install this. For example, we install iptraf for monitoring de real time ip trafic on XenServer.

# yum install iptraf

Type Y and Install.

and boala! I have iptraf for XenServer.

In the next post, i talk about interesting tools for Troubleshooting and Monitoring XenServer.

Thanks for Folowme 😉

Today speak of a task very easy, in some cases, can be a headache for administrators who come from Windows.

At times, the support team may request certain system logs for review.

XenCenter has an option to generate a zip file that contain information on logs and system commands.
But, as we import logs if we do not have XenCenter? see how to import specific logs with old method.

For do this, you need a ssh/scp software o use any terminal for connect to xenserver. I talk how do it from MAC/Linux and from Windows.


Only need to run a terminal/Shell and use the command scp for do this. How? See this.

Note. You need to know the exact path that containt the file that you need import.

If you need recover the messages log, for example, in your desktop terminal type:






# scp root@ c:UserscristiansanDesktop

Windows SO

How i do on Windows if we haven’t terminal?

All administrators know putty for SSH connections.
Another imprescidible tool for admins is winscp. Winscp, is a client sftp.

Log on XenServer with winscp gui and use a similar to FTP GUI interface for upload and download files from/to XenServer.

I don’t explain this tool because is very easy. Try it!


Putty: http://www.putty.org/
WinSCP: http://winscp.net/
Man SSH  Man SCP

Another resource in this blog related with this: SSH key: MAC/LINUX to XenServer without PASS

A few days ago, we had an incident with one client that he lost the connection with iscsi LUN where have the VM HDD.

The StorageRepository appear with de red blade and isn’t possible «reattach» process. When you do the action, we have the next message:

The attempt to query the iSCSi daemon failed

We don’t found error reported on Support Forums. In the logs of system i can see:

XenServer Log

ERROR XenAdmin.Actions.AsyncAction [3600] – The attempt to query the iSCSi daemon failed

ERROR XenAdmin.Actions.AsyncAction [3600] – en XenAdmin.Actions.SrRepairAction.Run() en XenAdmin.Actions.AsyncAction.RunWorkerThread(Object o)


Raising exception [86, Failed to query the iscsi daemon [opterr=Failed to logout from target]]

FAILED: (errno 5) stdout: », stderr: ‘ Volume group «VG_XenStorage-cc734a73-5a5f-5fd1-24cf- 308258bc1fd2» not found’

We tested in XenServer that you can validate with openiscsi perfectly but isn’t posible connect to LUN. Is strange because all other LUN in the NAS is not affected.

We destroy de PBD connector and recreate again, with de the same problem.

The customer talk with NAS Manufacturer and is necessary update de Firmware. It’s posible a NAS error, but if this the problem, how i recover the VMs on this LUN.

In this post i don’t  explain how to troublesshot de iscsi connection. I explain how to recover the LUN across the Live Linux Distribution.  Any LiveCD is valid.

You only need to run Linux SO. The first step is install the necessary packets for do the recuperation. You only need the OpeniScsi packets. LVM2 is optional if you like to try mount the filesystem.

We talk with the client and ask that is necessary to create a LUN with the same size that the corrupted lun. With this, i create a VM with XenServer and run the liveCD.

When the Linux Live is running, we need to open a terminal and install the necessary packets.

# sudo apt-get install open-iscsi

When the install is finished is time to connect with Lun and recover the information.  For do this…

Start iscsi daemon

# /etc/init.d/open-iscsi start

Discover targets

#iscsiadm -m discovery -t sendtargets -p [IP_Target]

IP_TARGET:3260,1 iqn.2002-10.com.target:RESOURCE1

IP_TARGET:3260,1 iqn.2002-10.com.target:RESOURCE2

IP_TARGET:3260,1 iqn.2002-10.com.target:RESOURCE3

establish the credentials

# iscsiadmin -m node -t IP_TARGET:3260,1 iqn.2002-10.com.target:RESOURCE1 -P [IP_Target] -o update -n node.session.auth.username -v [USER]

# iscsiadmin -m node -t IP_TARGET:3260,1 iqn.2002-10.com.target:RESOURCE1 -P [IP_Target] -o update -n node.session.auth.password-v [PASSWD]

and now connect to target

# iscsiadm -m node -t IP_TARGET:3260,1 iqn.2002-10.com.target:RESOURCE1 -p [IP_Target] -l

with fdisk -l, you can see the device used. In my case we use /dev/sdb.

Realice the same process for the New LUN created. Is mapped with the next device available. In my case: /dev/sdc

In this point is the moment for recover the info. And how i do?

It’s easy, we do a copy block to block from sdb device to sdc device.  For do this, we type the next command:

# dd if=/dev/sdb of=/dev/sdc bs=512 conv=noerror,sync

The process is slow and take his time. You can see if the command is running with TOP command or PS command. When the command is finished is time to create again the SR on XenCenter. The new SR with the old SR copy is ready to use.

For more info about this, i recommended read the man pages:




¿Do you need help with your Citrix Enviroments?

Visit us at www.ctxdom.com or contract us at www.101-consulting.com

Prepare XenServer for DVS

abril 4th, 2012 | Posted by cristiansan in Appliance | DVs | XenServer - (0 Comments)

2 years ago (October 2012) I wrote in ctxdom.com about #Citrix Virtual Distributed Switch.

You can read this article on the Following linkctxdom.com

There is a very important little point in implementing DVS. -Enable it on XenServer.

To perform this task, we logon on XenServer and run the following command inCLI.

xe-switch-network-backend openvswitch

This is very important, and that redirects all internal traffic through DVS and allows the performance of various tasks such as:
ACLs and QoS Policies; NetFlow; Traffic mirroring, Port Bonding & Per VMtraffic policy.

More info: http://support.citrix.com/article/CTX129669

If you need Disable this funtionality, you need run this command:
(dvs use can cause certain problems of congestion in some environment)

xe-switch-backend network-bridge

It is important to know the procedure to run this configuration. These are the recommendations:

1.Disable HA (before Any maintenance).
2.Migrate VMs off of host.
3.Enable bridge mode via command line: xe-switch-backend-network [bridgeoption]
5.Migrate VMs back.
6.Enable HA.

¿Do you need help with your Citrix Enviroments?

Visit us at www.ctxdom.com or contract us at www.101-consulting.com

Hi to all, and welcome again to my stupid blog 😛

Today i write about how connect with your XenServer without pass key on the ssh connection. This tutorial is base on a Mac SO but is equal to do on a Linux/Unix SO.

First you need generate the PassKey on your Mac. For this try with:


Follow the intructions. When you finish, it generate a file on /home/user/.ssh/ named id_rsa and a public key named id_rsa.pub.

The first is your identification and the second the public key.

Now, you only need copy the file id_rsa.pub and add the content file on the authorized_keys file on the XenServer.

For copy the key, i use the command SCP. For do it, put:

scp /home/USER/.shh/id_rsa.pub root@

and now, putt he content of id_rsa.pub to the file Authorized_keys with the command:

cat ./id_rsa.pub >> /root/.shh/authorized_keys

Now is time the connect without password on XenServer. See  the step by step process on the next video.