def _getLVM_physicalVolume(self, device):
     from comoonics.storage.ComLVM import LogicalVolume, LinuxVolumeManager, VolumeGroup 
     try:
         (vgname, lvname)=LogicalVolume.splitLVPath(device)
         _vg=VolumeGroup(vgname)
         _pv=LinuxVolumeManager.pvlist(_vg)
         ComLog.getLogger(__logStrLevel__).debug("detected physical volume %s" %_pv) 
         return _pv[0].getAttribute("name")
     except LogicalVolume.LVMInvalidLVPathException, e:
         ComLog.errorTraceLog()
         return
 def prepareAsSource(self):
     self.getVolumeGroup().init_from_disk()
     for pv in LinuxVolumeManager.pvlist(self.getVolumeGroup(), self.getDocument()):
         pv.init_from_disk()
         self.getVolumeGroup().addPhysicalVolume(pv)
     for lv in LinuxVolumeManager.lvlist(self.getVolumeGroup(), self.getDocument()):
         lv.init_from_disk()
         self.getVolumeGroup().addLogicalVolume(lv)
         if not lv.isActivated() and not self.activated:
             self.activated=True
             self.vg.activate()
 def _getLVM_physicalVolume(self, device):
     from comoonics.storage.ComLVM import LogicalVolume, LinuxVolumeManager, VolumeGroup
     try:
         (vgname, lvname) = LogicalVolume.splitLVPath(device)
         _vg = VolumeGroup(vgname)
         _pv = LinuxVolumeManager.pvlist(_vg)
         ComLog.getLogger(__logStrLevel__).debug(
             "detected physical volume %s" % _pv)
         return _pv[0].getAttribute("name")
     except LogicalVolume.LVMInvalidLVPathException, e:
         ComLog.errorTraceLog()
         return
Beispiel #4
0
 def prepareAsSource(self):
     self.getVolumeGroup().init_from_disk()
     for pv in LinuxVolumeManager.pvlist(self.getVolumeGroup(),
                                         self.getDocument()):
         pv.init_from_disk()
         self.getVolumeGroup().addPhysicalVolume(pv)
     for lv in LinuxVolumeManager.lvlist(self.getVolumeGroup(),
                                         self.getDocument()):
         lv.init_from_disk()
         self.getVolumeGroup().addLogicalVolume(lv)
         if not lv.isActivated() and not self.activated:
             self.activated = True
             self.vg.activate()