def _setPersistentDiskOptional(self): if not self.persistentDiskUUID: return self.pdiskEndpointHostname = VolumeManager.getFQNHostname(self.pdiskEndpoint) # Ensure that the pdiskEndpoint does not have a trailing slash. opts = self.__dict__.copy() opts['pdiskEndpoint'] = self.pdiskEndpoint.rstrip('/') self.persistent_disk = (self.persistentDiskUUID and Runner.PERSISTENT_DISK % opts) or '' self._checkPersistentDiskAvailable()
def _configureNfsServer(self): printStep('Configuring NFS sharing...') if self._nfsShareAlreadyExists(): self.system.configureExistingNfsShare(self.persistentDiskExistingNfs, self.persistentDiskNfsMountPoint) elif self.profile == 'node': self.system.configureExistingNfsShare('%s:%s' % ( VolumeManager.getFQNHostname(self.persistentDiskIp), self.persistentDiskNfsMountPoint), self.persistentDiskNfsMountPoint) else: self.system.configureNewNfsServer(self.persistentDiskNfsMountPoint, self.networkAddr, self.networkMask)
def _createDiskUrlIfDiskId(self, image): if Image.isDiskId(image): self.pdiskEndpointHostname = VolumeManager.getFQNHostname(self.pdiskEndpoint) return "pdisk:%s/%s" % (self.pdiskEndpoint.rstrip('/'), image) else: return image
def _checkUuid(self): for uuid in self.uuids: if not VolumeManager.isValidUuid(uuid): printError('Invalid UUID %s' % uuid)
def _isDbOnPdiskHost(self): return self.persistentDiskDbHost in ['localhost', '127.0.0.1', self.persistentDiskIp, VolumeManager.getFQNHostname(self.persistentDiskIp)]