After upgrading Citrix Hypervisor 8.0.0 to 8.1.0, all ISO CIFS SR became inaccessible.

The CIFS shares are held by our Samba server and they are available read-only without any authentication. Manually adding a new ISO CIFS SR revealed that the username must be specified as \ (blackslash), indicating no domain name and no username. No password is needed just as before.

Run this command creating a skeletal shell script.

xe sr-list type=iso params | egrep 'name-label|name-descr' | cut -d : -f 2 > fix-iso-cifs.sh

Remove lines not related to any ISO CIFS SRs (revealing that type=iso doesn’t do any filtering). Trim each line containing UNC paths. Leave a space in front of each UNC path. Double each occurence of the backslash character in the UNC paths.

Add these lines to the top of the script:

#!/bin/sh

mk_iso_cifs ()
{
  xe sr-create content-type=iso type=iso shared=true \
    device-config:location="$2" \
    device-config:username=\\ device-config:type=cifs \
    device-config:vers=3.0 name-label="$1" \
    name-description="SMB ISO Library [$2]"
}

Join the line for each description with the line for the associated UNC path. Add “mk_iso_cifs” in front of each line. Save the file and make it executable.

The resulting shell script might look like this:

#!/bin/sh

mk_iso_cifs ()
{
  xe sr-create content-type=iso type=iso shared=true \
    device-config:location="$2" \
    device-config:username=\\ device-config:type=cifs \
    device-config:vers=3.0 name-label="$1" \
    name-description="SMB ISO Library [$2]"
}

mk_iso_cifs "FreeBSD/amd64 stable/11 snapshots" \\\\hostname\\sharename\\dir1\\dir2\\FreeBSD\\snapshots\\ISO-IMAGES\\amd64\\11.3
mk_iso_cifs "FreeBSD/amd64 stable/12 snapshots" \\\\hostname\\sharename\\dir1\\dir2\\FreeBSD\\snapshots\\ISO-IMAGES\\amd64\\12.1

Remove the inaccessible ISO CIFS SR using Citrix XenCenter and run the above script from the console. The value for description (name-description) is ignored for some unknown reason.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>