Пример #1
0
    def init_host(self, host):
        # TODO(mriedem): Consider deprecating the driver if there is still no
        # working 3rd party CI by the end of the Train release.
        LOG.warning('The xenapi driver is not tested by the OpenStack '
                    'project and thus its quality can not be ensured. The '
                    'driver may be deprecated in the future.')

        if CONF.xenserver.independent_compute:
            # Check various options are in the correct state:
            if CONF.xenserver.check_host:
                invalid_option('CONF.xenserver.check_host', False)
            if CONF.flat_injected:
                invalid_option('CONF.flat_injected', False)
            if CONF.default_ephemeral_format and \
               CONF.default_ephemeral_format != 'ext3':
                invalid_option('CONF.default_ephemeral_format', 'ext3')

        if CONF.xenserver.check_host:
            vm_utils.ensure_correct_host(self._session)

        if not CONF.xenserver.independent_compute:
            try:
                vm_utils.cleanup_attached_vdis(self._session)
            except Exception:
                LOG.exception(_('Failure while cleaning up attached VDIs'))
Пример #2
0
    def init_host(self, host):
        LOG.warning('The xenapi driver is deprecated and may be removed in a '
                    'future release. The driver is not tested by the '
                    'OpenStack project nor does it have clear maintainer(s) '
                    'and thus its quality can not be ensured. If you are '
                    'using the driver in production please let us know in '
                    'freenode IRC and/or the openstack-discuss mailing list.')

        if CONF.xenserver.independent_compute:
            # Check various options are in the correct state:
            if CONF.xenserver.check_host:
                invalid_option('CONF.xenserver.check_host', False)
            if CONF.flat_injected:
                invalid_option('CONF.flat_injected', False)
            if CONF.default_ephemeral_format and \
               CONF.default_ephemeral_format != 'ext3':
                invalid_option('CONF.default_ephemeral_format', 'ext3')

        if CONF.xenserver.check_host:
            vm_utils.ensure_correct_host(self._session)

        if not CONF.xenserver.independent_compute:
            try:
                vm_utils.cleanup_attached_vdis(self._session)
            except Exception:
                LOG.exception(_('Failure while cleaning up attached VDIs'))
Пример #3
0
    def init_host(self, host):
        if CONF.xenserver.independent_compute:

            def invalid_option(option_name, recommended_value):
                LOG.exception(
                    _LE('Current value of '
                        'CONF.xenserver.%(option)s option incompatible with '
                        'CONF.xenserver.independent_compute=True.  '
                        'Consider using "%(recommended)s"') % {
                            'option': option_name,
                            'recommended': recommended_value
                        })
                raise exception.NotSupportedWithOption(
                    operation=option_name,
                    option='CONF.xenserver.independent_compute')

            # Check various options are in the correct state:
            if CONF.xenserver.check_host:
                invalid_option('CONF.xenserver.check_host', False)
            if CONF.flat_injected:
                invalid_option('CONF.flat_injected', False)
            if CONF.default_ephemeral_format and \
               CONF.default_ephemeral_format != 'ext3':
                invalid_option('CONF.default_ephemeral_format', 'ext3')

        if CONF.xenserver.check_host:
            vm_utils.ensure_correct_host(self._session)

        if not CONF.xenserver.independent_compute:
            try:
                vm_utils.cleanup_attached_vdis(self._session)
            except Exception:
                LOG.exception(_LE('Failure while cleaning up attached VDIs'))
Пример #4
0
    def init_host(self, host):
        if CONF.xenserver.independent_compute:
            def invalid_option(option_name, recommended_value):
                LOG.exception(_LE('Current value of '
                       'CONF.xenserver.%(option)s option incompatible with '
                       'CONF.xenserver.independent_compute=True.  '
                       'Consider using "%(recommended)s"') % {
                           'option': option_name,
                           'recommended': recommended_value})
                raise exception.NotSupportedWithOption(
                    operation=option_name,
                    option='CONF.xenserver.independent_compute')

            # Check various options are in the correct state:
            if CONF.xenserver.check_host:
                invalid_option('CONF.xenserver.check_host', False)
            if CONF.flat_injected:
                invalid_option('CONF.flat_injected', False)
            if CONF.default_ephemeral_format and \
               CONF.default_ephemeral_format != 'ext3':
                invalid_option('CONF.default_ephemeral_format', 'ext3')

        if CONF.xenserver.check_host:
            vm_utils.ensure_correct_host(self._session)

        if not CONF.xenserver.independent_compute:
            try:
                vm_utils.cleanup_attached_vdis(self._session)
            except Exception:
                LOG.exception(_LE('Failure while cleaning up attached VDIs'))
Пример #5
0
    def init_host(self, host):
        if FLAGS.xenapi_check_host:
            vm_utils.ensure_correct_host(self._session)

        try:
            vm_utils.cleanup_attached_vdis(self._session)
        except Exception:
            LOG.exception(_('Failure while cleaning up attached VDIs'))
Пример #6
0
    def init_host(self, host):
        if CONF.xenserver.check_host:
            vm_utils.ensure_correct_host(self._session)

        try:
            vm_utils.cleanup_attached_vdis(self._session)
        except Exception:
            LOG.exception(_('Failure while cleaning up attached VDIs'))
Пример #7
0
    def init_host(self, host):
        if CONF.xenserver.check_host:
            vm_utils.ensure_correct_host(self._session)

        try:
            vm_utils.cleanup_attached_vdis(self._session)
        except Exception:
            LOG.exception(_("Failure while cleaning up attached VDIs"))
Пример #8
0
    def init_host(self, host):
        LOG.warning(_('The xenapi driver does not meet the Nova project\'s '
                      'requirements for quality verification and is planned '
                      'for removal. This may change, but users should plan '
                      'accordingly. Additional details here: '
                      'https://wiki.openstack.org/wiki/HypervisorSupportMatrix'
                      '/DeprecationPlan'))
        if CONF.xenserver.check_host:
            vm_utils.ensure_correct_host(self._session)

        try:
            vm_utils.cleanup_attached_vdis(self._session)
        except Exception:
            LOG.exception(_('Failure while cleaning up attached VDIs'))
Пример #9
0
    def init_host(self, host):
        LOG.warning(_('The xenapi driver does not meet the Nova project\'s '
                      'requirements for quality verification and is planned '
                      'for removal. This may change, but users should plan '
                      'accordingly. Additional details here: '
                      'https://wiki.openstack.org/wiki/HypervisorSupportMatrix'
                      '/DeprecationPlan'))
        if CONF.xenserver.check_host:
            vm_utils.ensure_correct_host(self._session)

        try:
            vm_utils.cleanup_attached_vdis(self._session)
        except Exception:
            LOG.exception(_('Failure while cleaning up attached VDIs'))
Пример #10
0
    def init_host(self, host):
        if CONF.xenserver.independent_compute:
            # Check various options are in the correct state:
            if CONF.xenserver.check_host:
                invalid_option('CONF.xenserver.check_host', False)
            if CONF.flat_injected:
                invalid_option('CONF.flat_injected', False)
            if CONF.default_ephemeral_format and \
               CONF.default_ephemeral_format != 'ext3':
                invalid_option('CONF.default_ephemeral_format', 'ext3')

        if CONF.xenserver.check_host:
            vm_utils.ensure_correct_host(self._session)

        if not CONF.xenserver.independent_compute:
            try:
                vm_utils.cleanup_attached_vdis(self._session)
            except Exception:
                LOG.exception(_('Failure while cleaning up attached VDIs'))
Пример #11
0
    def init_host(self, host):
        if CONF.xenserver.independent_compute:
            # Check various options are in the correct state:
            if CONF.xenserver.check_host:
                invalid_option('CONF.xenserver.check_host', False)
            if CONF.flat_injected:
                invalid_option('CONF.flat_injected', False)
            if CONF.default_ephemeral_format and \
               CONF.default_ephemeral_format != 'ext3':
                invalid_option('CONF.default_ephemeral_format', 'ext3')

        if CONF.xenserver.check_host:
            vm_utils.ensure_correct_host(self._session)

        if not CONF.xenserver.independent_compute:
            try:
                vm_utils.cleanup_attached_vdis(self._session)
            except Exception:
                LOG.exception(_('Failure while cleaning up attached VDIs'))
Пример #12
0
 def init_host(self, host):
     try:
         vm_utils.cleanup_attached_vdis(self._session)
     except Exception:
         LOG.exception(_('Failure while cleaning up attached VDIs'))