----- Original Message -----
From: "Shu Ming" shuming@linux.vnet.ibm.com To: "VDSM Project Development" vdsm-devel@lists.fedorahosted.org Sent: Tuesday, October 30, 2012 7:22:18 AM Subject: [vdsm] A question about the SPM operation permission in VDSM
Hi,
In the VDSM code about some SPM operations like HSM.deleteImage(), It is found that VDSM doesn't check if the operation will be launched on a SPM host or not. It only checks if the storage pool is already acquired by one SPM host, but not necessary the same host as the SPM operation is delivered to. The code is like this:
HSM.deleteImage() { ... HSM._spmSchedule() { self.validateSPM(spUUID) <--- Only check if the storage pool was acquired by one host, but not necessary this host } ... }
So it really depends on the node management application AKA ovirt-engine to dispatch the SPM operations to the right VDSM host.
Hi Shu, validateSPM is:
def validateSPM(self, spUUID): pool = self.getPool(spUUID) if pool.spmRole != sp.SPM_ACQUIRED: raise se.SpmStatusError(spUUID)
despite its ambiguous name "SPM_ACQUIRED" refers only to the spmRole of the current host. That said, vdsm actually checks before running deleteImage if the host is actually the SPM or not. Eventually you can verify it running deleteImage on an HSM host, it should fail with:
# vdsClient 0 deleteImage ... Not SPM: ('<spUUID>',)