Delete multiple XenServer orphan SR’s

When a Citrix XenServer, member of a Resource Pool, is reinstalled the local storage repositories (Local storage, DVD drive) are left in the resource pool as orphans. In XenCenter, below a Resource Pool, these SR’s are marked with a red bullet.

When there are a few of these orphaned SR, you can remove these with the console command:

Note uuid of the SR’s with:

To delete this SR:

But what to do if there are to much of the orphaned SR’s ? The procedure above is very time-consuming.

Lets see if Powershell can help solve this problem. For XenServer, as for other Citrix products, are Powershell cmd-lets available. With the help from this Pdf I found the cmd-let to get the SR list.

The command let to get a list of all the SR’s is:

I had to find out which property of the SR’s is one of the orphaned SR’s… It appears that an orphaned SR has no PBD’s assigned. Because this property is returned as an array I need a way to determine a way to check this. When an array is empty teh array count is “0”.

Now we have al the UUID os the orpahned SR’s. To delete a SR in Powershell:

Combined in a script, with all the logic and cmd-lets check, will result in:

 

 

Script Convert-ExcelSerialdate

When converting an Excel sheet, containing a column with dates, to a CSV file, the column in the CSV file contains nummeric values instead of date values. These numeric values are Serial dateformated values, used internal by Excel to calculate the date.

More info: Link

I wrote a Powershell function to convert the Excle serial date to a .Net date object:

Example code

 

 

Kef PSW2000 Subwoofer problem

Since a month I have a problem with my Kef PSW2000 sub-woofer. When the sub-woofer is on power is making a funny noise, a buzzing sound. The sound is originating from the back of the case.
I started searching om google for a solution to this problem. When I came across some forums, I found a site completely dedicated to problems with the Kef sub-woofers.

Update: I fixed my PSW-2000 last Saturday!!!! happy subwoofing.

 

Batch file: CheckIMAService