From 7c231c98f6fe659c77ecfb8c4e83d4c3d69a88e5 Mon Sep 17 00:00:00 2001 From: frank Date: Mon, 14 Nov 2011 10:22:48 -0800 Subject: [PATCH] Bug 12007 - OVM - Addition of OVM host fails - NPE (edit) skip scanning stopped VMs on primary storage if it is not existing, because first time fullsync() called the primary storage has not been mounted status 12007: resolved fixed reviewed-by: edison --- ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py b/ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py index 29a9f9ae393..f93070fe019 100755 --- a/ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py +++ b/ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py @@ -183,6 +183,10 @@ class OvmHost(OvmObject): mps = OvmStoragePool()._getAllMountPoints() for mountPoint in mps: runningPool = join(mountPoint, 'running_pool') + if not exists(runningPool): + logger.debug(OvmHost.getAllVms,, "Primary storage %s not existing, skip it. this should be first getAllVms() called from Ovm resource configure"%runningPool) + continue + for dir in os.listdir(runningPool): vmDir = join(runningPool, dir) if not isMyVmDirLink(vmDir):