Tag Archives: Xenserver

XenServer: Powershell

If you like Powershell, you will like the XenServer Powershell.

Download XenServer SDK from the Citrix.com download page (You need to logon with you Citrix credentitals)

After you have install Citrix Xenserver Powershell, you can test to see if it have been install by running this comands:

Get-PSSnapin -registered

If it installed, you can add it to you powershell session by typing this command:

Add-PSSnapin Xen*

To connect to the XenServer

Connect-XenServer -Url https://<ServerIP>

To get all vm on the Xenserver:

Get-XenServer:VM

To only show the VM with VDI in the middle of the name

Get-XenServer:VM -name *vdi*

To see all command from XenServer Powershell

Get-Command -module Xen*

 

See more commands here:

http://kennethdalbjerg.dk/wp-content/uploads/2013/05/Citrix_XenServer_6.0_CmdLet_Poster.pdf
http://www.qa.com/about-qa/blogs/2012/july/citrix-xenserver-6-and-powershell/

XenServer: Add an extra Core to a CPU Socket

You can’t add extra Core to a CPU socket though XenCenter, you need to start you console of the XenServer.

To Add 4 Core in each CPU Socket you need to run this commands:

xe vm-param-set platform:cores-per-socket=4 uuid=<VM UUID>

To found the vm’s UUID, you can use these commands:

xe vm-list name-label=<Name of the VM>

After you have put 4 core in each CPU socket you also need to run these commands:

xe vm-param-set VCPUs-max=8 uuid=<VM UUID>
xe vm-param-set VCPUs-at-startup=8 uuid=<VM UUID>

This will add 8 CPU in totalt, but only 2 CPU socket with each 4 Core.

Xenserver – Problems with the master of the pool, down – dead or corrupt

If you have problems, that you master is dead or have som troubles, and you need to selected a new master, you can do this with this commands:

xe pool-emergency-transition-to-master

Then on the others slave you can run this commands:

xe pool-emergency-reset-master master-address=NewMasterAddress

And then when the master is running again run this command on the old master

xe pool-emergency-reset-master master-address=NewMasterAddress

Kill a stuck vm in shuting down mode or pending mode

There are 3 options to do this, witch way depend on the stuck mode, start with options 1 and work you way thougt it onto the vm is shutdown.

Options 1:

SSH to the Xenserver witch running the vm

Type these commands:

xe task-list

Found the task and the UUID for this task, and kill it

xe task-cancel force=true uuid=<UUID>

 Options 2:

SSH to the Xenserver witch running the vm

xe vm-list

Find the vm han get the UUID

list_domains | grep <UUID>

Get the number in front of the UUID

/opt/xensource/debug/destroy_domain -domid <DOMID>

Options 3:

SSH to the Xenserver witch running the vm

xe-toolstack-restart

 

XenCenter – Failed to import

I have a problem with my Xencenter failed to import a OVF VM.
In XenCenter console, it just says: Failed to import.

If i look in the log files is was saying: (In XenCenter Console, push tab Help, and then clock on “View application log files. And then open op XenCenter.log):

System.Exception: Failed to import. —> System.IO.InvalidDataException: Failed to add resource Hard Disk Image. —> System.Exception: Failed to import. —> System.Exception: Failed to import virtual disk file. —> System.Xml.XmlException: Root element is missing.

Error on a Danish windows

System.Exception: Failed to import. —> System.IO.InvalidDataException: Failed to add resource Hard Disk Image. —> System.Exception: Failed to import. —> System.Exception: Failed to import virtual disk file. —> System.Xml.XmlException: Rod element mangler.

To fix this problem I did:
In XenCenter, select View -> Hidden Objects
This will show you hidden objects, such as Transfer objects.
Found the failed imported machine, right click on it and delete it.
Now you should found a XenServer Tranfer VM X.X.X-X, right click on it and delete it.

Now connect to the console on the XenServer host: (Master of the pool if you have such one)
And type this commands:

cd /opt/xensource/packages/files/transfer-vm
./install-transfer-vm.sh

Xenserver – Moving VM “VDINAME” to “VDINAME” on “Storage” This operation cannot be performed because this VDI OpaqueRef:8d37bee1-f85b-fb22-e47e-1b8f48b68b84 is in use by some other operation – copy

I have this error:

Moving VM “VDINAME” to “VDINAME” on “Storage” This operation cannot be performed because this VDI OpaqueRef:8d37bee1-f85b-fb22-e47e-1b8f48b68b84 is in use by some other operation – copy

When i was try moving a VM from from storage to another on XenServer. It was just because there was a DVD ISO mounted on the VM, when i Eject that one, the move was just running fine.

 

Citrix Xenconvert failed with Failed to discover 1 of 2 volumes on the destination disk! or Enable Automount on windows server Enterprise edition and run Disk Management once to take effect

Today i should convert a machine with XenConvert to XenServer, but it come with these errors:

Failed to discover 1 of 2 volumes on the destination disk!
Enable Automount on windows server Enterprise edition and run Disk Management once to take effect

What i did to fix it was:

First enable automount

C:\> DiskPart
DISKPART> automount enable
DISKPART> exit

If it still not working try this:

  1. Close XenConvert.
  2. Open a command window.
  3. Change to the XenConvert installation folder
  4. Mount the VHD:
    cvhdmount -p 1 <VHD file path>
  5. Open Windows Disk Management, then wait for the disk to appear online in Windows Disk Management, maybe you need to rescan
  6. Verify that the volumes are accessible
  7. Dismount the VHD
    cvhdmount -e 1
  8. Last thing to is editing XenConvert.ini file in c:\program files\citrix\xenconvert\xenconvert.ini
    And put this under [Parameters]
    VolumeDiscoveryTimeoutAsSeconds=120

Then try run XenConvert again.

Stop error 0xc0000225 on P2V’d Windows 2008 R2

I have P2V a windows 2008 R2, from Xenserver to vmware.

But after the first good boot, it come with: Status: 0xc0000225, Info: The boot selection failed because a required device is inaccessible.

The machine will startup just fine one time, first i thougt it was the uninstall of XenServer tools?.
So i try to remove the Xenserver tools, before the P2V, but again i godt 0xC000225 error again.

I then google it, and found this post: http://web2.minasi.com/forum/topic.asp?TOPIC_ID=31980, and the fix was pretty simple:

  • Mount the Windows 2008 R2DVD in VMware and boot the virtual machine, with CDRom boot at the first boot device.
  • Hit any key to boot from the CDRrom.
  • At the first screen of the installation (Language Selection), you can hit Shift-F10 to get a command prompt.
  • Type Regedit at the command prompt.
  • Loaded hive HKEY_LOCAL_MACHINE (which mounts as a sub-hive)
    1. Highlight HKEY_LOCAL_MACHINE
    2. File > Load Hive
    3. Select < c: > \Windows\System32\config\system (name it something like “qwerty”)
  • Expand HKEY_LOCAL_MACHINE\qwerty\ControlSet001\Services\intelide
  • Change the data for value “Start” from “3” to “0”.
  • File > Unload Hive.
  • Exit regedit.
  • Reboot the VM.

 

Xencenter / Xenserver This operation cannot be performed because the specified VDI could not be found on the storage substrate

Today i got this when i was trying to start a VDI on my Xenceter.

This operation cannot be performed because the specified VDI could not be found on the storage substrate

This was because of that i have a CDrom mounted on a CIFS shares that isn’t available anymore, after remove the ISO, the VDI start perfects again.