Esempio n. 1
0
 def _check_csv(self, resource_inventory):
     host_ip = resource_inventory[constants.EON_RESOURCE_IP_ADDRESS]
     activation_msg = ("Validate Cluster and/or CSV")
     LOG.info(activation_msg)
     if not self.hyperv_utilities:
         self.hyperv_utilities = hyperv_utils.HyperVUtils(
             resource_inventory)
     cluster_state = self.hyperv_utilities.get_csv()
     if (cluster_state == "Standalone"):
         LOG.info("Hyper-V compute %s is not in a Cluster" % host_ip)
     elif (cluster_state == "Cluster"):
         LOG.info("Hyper-V compute %s is in a Cluster and CSV defined"
                    " is valid" % host_ip)
     elif(cluster_state):
         corrective_action = ("Manually modify  Virtual Hard disk path "
             "in Hyper-V manager to one of these " + cluster_state)
         error_msg = (_("Instance_path defined in Hyper-V manager is "
                        "not Valid CSV Path"))
         log_error_msg = (("Instance_path defined in Hyper-V manager is "
                        "not Valid CSV Path"))
         LOG.error(log_error_msg)
         LOG.info(corrective_action)
         raise exception.EonException(message=error_msg)
     else:
         corrective_action = ("Manually enable Cluster Shared Volume and"
                                " assign to Virtual Hard disk path in "
                                "Hyper-V manager")
         error_msg = (_("Cluster Shared volume is not enabled"))
         log_error_msg = ("Cluster Shared volume is not enabled")
         LOG.error(log_error_msg)
         LOG.info(corrective_action)
         raise exception.EonException(message=error_msg)
Esempio n. 2
0
    def _check_for_hyperv_version(self, collected_inventory,
                                  resource_inventory):
        host_ip = resource_inventory[constants.EON_RESOURCE_IP_ADDRESS]
        activation_msg = ('Verifying Hyper-V version and OS '
                          'edition on compute %s') % (host_ip)
        corrective_action = ('Consult the HP Helion CloudSystem '
            'Installation and Configuration Guide for '
            'supported Hyper-V versions and editions')
        _HYPERV_MAJOR_VERSION = 6
        _HYPERV_MINOR_VERSION = 3
        _HYPERV_OS_EDITIONS = {7: "Standard Server Edition",
                               8: "Datacenter Server Edition",
                               12: "Datacenter Server Core Edition",
                               13: "Standard Server Core Edition",
                               42: "Hyper-V Server"}
        LOG.info(activation_msg)
        os_version = collected_inventory.get('os_version')
        if os_version is not None:
            version = str(os_version['Major']) + "." + str(os_version['Minor'])
            if not (os_version['Major'] == _HYPERV_MAJOR_VERSION and
                    os_version['Minor'] >= _HYPERV_MINOR_VERSION):
                error_msg = ('Unsupported Hyper-V version %s on '
                            'host %s') % (version, host_ip,)
                corrective_action = ("Supported Hyper-V version is "
                                   "'WIN 2012 R2'")
                LOG.error(error_msg)
                LOG.info(corrective_action)
                raise exception.HyperVHostUnSupportedOSError()
        else:
            raise exception.EonException(
                message=(_("An unknown exception occurred getting Hyper-V "
                           "version from host %s ")) % (host_ip))

        os_edition = collected_inventory.get('os_edition')
        supported_os_editions = CONF.HyperV_Host.supported_os_editions
        if os_edition is not None:
            if os_edition['number'] not in supported_os_editions:
                error_msg = ('Unsupported OS edition %s on '
                            'Hyper-V host %s') % (os_edition['name'],
                                           host_ip,)
                corrective_action = ("Supported OS editions are %s" %
                                        _HYPERV_OS_EDITIONS.values())
                LOG.error(error_msg)
                LOG.info(corrective_action)
                raise exception.HyperVHostUnSupportedOSEditionError()
        else:
            LOG.info(corrective_action)
            raise exception.EonException(message=(_("An unknown exception "
                "occurred getting OS edition from Hyper-V "
                "host %s " % host_ip)))
        LOG.info("Hypervisor version is"
                   " %(version)s and OS edition is %(edition)s"
                   % {"version": version, "edition": os_edition['name']})
Esempio n. 3
0
    def _check_isci_initiator_service(self, collected_inventory,
                                      resource_inventory):
        host_ip = resource_inventory[constants.EON_RESOURCE_IP_ADDRESS]
        activation_msg = ('Verifying if iSCSI Initiator service on Hyper-V'
                          ' compute %s is running' % (host_ip))
        error_msg = (_('iSCSI Initiator service is not running on Hyper-V '
                     'compute %s') % (host_ip))
        corrective_action = ('Start the iSCSI Initiator service '
                'manually on Hyper-V compute %s' % (host_ip))
        LOG.info(activation_msg)
        iSCSIState = collected_inventory.get('iSCSI_initiator_service_state')
        if not iSCSIState:
            LOG.info(corrective_action)
            raise exception.EonException(message=error_msg)

        LOG.info("Verified successfully running state of iSCSI"
        " initiator service on Hyper-V compute %s" % (host_ip))
Esempio n. 4
0
    def _check_compute_host_name(self, collected_inventory,
                                 resource_inventory):
        host_ip = resource_inventory[constants.EON_RESOURCE_IP_ADDRESS]
        activation_msg = ('Verifying if hostname and Win32_ComputerSystem'
                          ' name are same. %s'
                        % (host_ip))
        error_msg = (_('Hostname and Win32_ComputerSystem name'
                     ' are different. %s') % (host_ip))
        corrective_action = ('Make sure that hostname is set'
                             ' to less than 15 characters %s'
                           % (host_ip))
        LOG.info(activation_msg)
        hostname = collected_inventory.get('valid_compute_name')
        if not hostname:
            LOG.info(corrective_action)
            raise exception.EonException(message=error_msg)

        LOG.info("Verified that hostname is valid  %s"
                                % (host_ip))
Esempio n. 5
0
    def __get_backend(self):
        if not self.__backend:
            if self.__config_group is None:
                backend_name = CONF[self.__pivot]
            else:
                backend_name = CONF[self.__config_group][self.__pivot]
            if backend_name not in self.__backends:
                msg = _('Invalid backend: %s') % backend_name
                raise exception.EonException(msg)

            backend = self.__backends[backend_name]
            if isinstance(backend, tuple):
                name = backend[0]
                fromlist = backend[1]
            else:
                name = backend
                fromlist = backend

            self.__backend = __import__(name, None, None, fromlist)
        return self.__backend
Esempio n. 6
0
    def _check_date_from_controller(self, collected_inventory,
                                    resource_inventory):
        host_ip = resource_inventory[constants.EON_RESOURCE_IP_ADDRESS]
        activation_msg = ("Verifying Hyper-V compute %s time with Cloud "
                          "controller" % (host_ip))
        error_msg = (_("Unable to synchronize Hyper-V compute %s time with "
                "Cloud controller") % (host_ip))
        log_error_msg = (("Unable to synchronize Hyper-V compute %s time with "
                "Cloud controller") % (host_ip))
        LOG.info(activation_msg)
        if not collected_inventory.get('host_date_configured'):
            corrective_action = ("Synchronize manually the "
                "Cloud system management appliances and HyperV compute "
                "hosts in the cluster to common ntp server")
            LOG.error(log_error_msg)
            LOG.info(corrective_action)
            raise exception.EonException(message=error_msg)

        LOG.info("Hyper-V compute %s time "
                    "is in sync with Cloud controller"
                    % (host_ip))
Esempio n. 7
0
 def check(*args, **kwargs):
     try:
         return rpc_call(*args, **kwargs)
     except rpc_common.RemoteError as e:
         raise exc.EonException(e.value)