From 83dcf2046060b275373993959b118bb2f3f3ff58 Mon Sep 17 00:00:00 2001 From: Bob Ball Date: Sun, 29 Sep 2013 21:45:49 +0100 Subject: [PATCH] XenAPI: Get pool default SR rather than "Local storage" Match the nova default of using the Pool default SR as the storage for VMs Change-Id: I3b681ae7062ba0db3d9eab70b410b7d9658e37c9 --- tools/xen/functions | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/xen/functions b/tools/xen/functions index a5c4b70bc3..a1d56568a8 100644 --- a/tools/xen/functions +++ b/tools/xen/functions @@ -69,11 +69,17 @@ function install_xapi_plugins_from { } function get_local_sr { - xe sr-list name-label="Local storage" --minimal + xe pool-list params=default-SR minimal=true } function get_local_sr_path { - echo "/var/run/sr-mount/$(get_local_sr)" + pbd_path="/var/run/sr-mount/$(get_local_sr)" + pbd_device_config_path=`xe pbd-list sr-uuid=$(get_local_sr) params=device-config | grep " path: "` + if [ -n "$pbd_device_config_path" ]; then + pbd_uuid=`xe pbd-list sr-uuid=$(get_local_sr) minimal=true` + pbd_path=`xe pbd-param-get uuid=$pbd_uuid param-name=device-config param-key=path || echo ""` + fi + echo $pbd_path } function find_ip_by_name() {