Beispiel #1
0
 def mountpoint_available_from_voldrv(mountpoint, storagedriver_id):
     """
     Hook for (re)exporting the NFS mountpoint
     """
     storagedriver = StorageDriverList.get_by_storagedriver_id(
         storagedriver_id)
     if storagedriver is None:
         raise RuntimeError(
             'A Storage Driver with id {0} could not be found.'.format(
                 storagedriver_id))
     if storagedriver.storagerouter.pmachine.hvtype == 'VMWARE':
         nfs = Nfsexports()
         nfs.unexport(mountpoint)
         nfs.export(mountpoint)
         nfs.trigger_rpc_mountd()
Beispiel #2
0
 def mountpoint_available_from_voldrv(mountpoint, storagedriver_id):
     """
     Hook for (re)exporting the NFS mountpoint
     """
     storagedriver = StorageDriverList.get_by_storagedriver_id(storagedriver_id)
     if storagedriver is None:
         raise RuntimeError('A Storage Driver with id {0} could not be found.'.format(storagedriver_id))
     if storagedriver.storagerouter.pmachine.hvtype == 'VMWARE':
         nfs = Nfsexports()
         nfs.unexport(mountpoint)
         nfs.export(mountpoint)
         nfs.trigger_rpc_mountd()
Beispiel #3
0
 def up_and_running(mountpoint, storagedriver_id):
     """
     Volumedriver informs us that the service is completely started. Post-start events can be executed
     """
     storagedriver = StorageDriverList.get_by_storagedriver_id(storagedriver_id)
     if storagedriver is None:
         raise RuntimeError('A Storage Driver with id {0} could not be found.'.format(storagedriver_id))
     storagedriver.startup_counter += 1
     storagedriver.save()
     if storagedriver.storagerouter.pmachine.hvtype == 'VMWARE':
         client = SSHClient(storagedriver.storagerouter)
         if client.config_read('ovs.storagedriver.vmware_mode') == 'classic':
             nfs = Nfsexports()
             nfs.unexport(mountpoint)
             nfs.export(mountpoint)
             nfs.trigger_rpc_mountd()
Beispiel #4
0
 def up_and_running(mountpoint, storagedriver_id):
     """
     Volumedriver informs us that the service is completely started. Post-start events can be executed
     :param mountpoint: Mountpoint to check
     :param storagedriver_id: ID of the storagedriver
     """
     storagedriver = StorageDriverList.get_by_storagedriver_id(storagedriver_id)
     if storagedriver is None:
         raise RuntimeError('A Storage Driver with id {0} could not be found.'.format(storagedriver_id))
     storagedriver.startup_counter += 1
     storagedriver.save()
     if storagedriver.storagerouter.pmachine.hvtype == 'VMWARE':
         client = SSHClient(storagedriver.storagerouter)
         machine_id = System.get_my_machine_id(client)
         if EtcdConfiguration.get('/ovs/framework/hosts/{0}/storagedriver|vmware_mode'.format(machine_id)) == 'classic':
             nfs = Nfsexports()
             nfs.unexport(mountpoint)
             nfs.export(mountpoint)
             nfs.trigger_rpc_mountd()
Beispiel #5
0
 def up_and_running(mountpoint, storagedriver_id):
     """
     Volumedriver informs us that the service is completely started. Post-start events can be executed
     :param mountpoint: Mountpoint to check
     :param storagedriver_id: ID of the storagedriver
     """
     storagedriver = StorageDriverList.get_by_storagedriver_id(storagedriver_id)
     if storagedriver is None:
         raise RuntimeError('A Storage Driver with id {0} could not be found.'.format(storagedriver_id))
     storagedriver.startup_counter += 1
     storagedriver.save()
     if storagedriver.storagerouter.pmachine.hvtype == 'VMWARE':
         client = SSHClient(storagedriver.storagerouter)
         machine_id = System.get_my_machine_id(client)
         if EtcdConfiguration.get('/ovs/framework/hosts/{0}/storagedriver|vmware_mode'.format(machine_id)) == 'classic':
             nfs = Nfsexports()
             nfs.unexport(mountpoint)
             nfs.export(mountpoint)
             nfs.trigger_rpc_mountd()