コード例 #1
0
    def daemon(self, child_args=None):
        logger.info("Run daemon")

        self.protocol_util = get_protocol_util() # pylint: disable=W0201
        self.scvmm_handler = get_scvmm_handler() # pylint: disable=W0201
        self.resourcedisk_handler = get_resourcedisk_handler() # pylint: disable=W0201
        self.rdma_handler = get_rdma_handler() # pylint: disable=W0201
        self.provision_handler = get_provision_handler() # pylint: disable=W0201
        self.update_handler = get_update_handler() # pylint: disable=W0201

        if conf.get_detect_scvmm_env():
            self.scvmm_handler.run()

        if conf.get_resourcedisk_format():
            self.resourcedisk_handler.run()

        # Always redetermine the protocol start (e.g., wireserver vs.
        # on-premise) since a VHD can move between environments
        self.protocol_util.clear_protocol()

        self.provision_handler.run()

        # Once we have the protocol, complete initialization of the telemetry fields
        # that require the goal state and IMDS
        self._initialize_telemetry()

        # Enable RDMA, continue in errors
        if conf.enable_rdma():
            nd_version = self.rdma_handler.get_rdma_version()
            self.rdma_handler.install_driver_if_needed()

            logger.info("RDMA capabilities are enabled in configuration")
            try:
                # Ensure the most recent SharedConfig is available
                # - Changes to RDMA state may not increment the goal state
                #   incarnation number. A forced update ensures the most
                #   current values.
                protocol = self.protocol_util.get_protocol()
                if type(protocol) is not WireProtocol: # pylint: disable=C0123
                    raise Exception("Attempt to setup RDMA without Wireserver")

                protocol.client.update_goal_state(forced=True)

                setup_rdma_device(nd_version, protocol.client.get_shared_conf())
            except Exception as e: # pylint: disable=C0103
                logger.error("Error setting up rdma device: %s" % e)
        else:
            logger.info("RDMA capabilities are not enabled, skipping")

        self.sleep_if_disabled()

        # Disable output to /dev/console once provisioning has completed
        if logger.console_output_enabled():
            logger.info("End of log to /dev/console. The agent will now check for updates and then will process extensions.")
            logger.disable_console_output()

        while self.running:
            self.update_handler.run_latest(child_args=child_args)
コード例 #2
0
    def daemon(self, child_args=None):
        logger.info("Run daemon")

        self.protocol_util = get_protocol_util()
        self.scvmm_handler = get_scvmm_handler()
        self.resourcedisk_handler = get_resourcedisk_handler()
        self.rdma_handler = get_rdma_handler()
        self.provision_handler = get_provision_handler()
        self.update_handler = get_update_handler()

        # Create lib dir
        if not os.path.isdir(conf.get_lib_dir()):
            fileutil.mkdir(conf.get_lib_dir(), mode=0o700)
            os.chdir(conf.get_lib_dir())

        if conf.get_detect_scvmm_env():
            self.scvmm_handler.run()

        if conf.get_resourcedisk_format():
            self.resourcedisk_handler.run()

        # Always redetermine the protocol start (e.g., wireserver vs.
        # on-premise) since a VHD can move between environments        
        self.protocol_util.clear_protocol()

        self.provision_handler.run()

        # Enable RDMA, continue in errors
        if conf.enable_rdma():
            self.rdma_handler.install_driver()

            logger.info("RDMA capabilities are enabled in configuration")
            try:
                # Ensure the most recent SharedConfig is available
                # - Changes to RDMA state may not increment the goal state
                #   incarnation number. A forced update ensures the most
                #   current values.
                protocol = self.protocol_util.get_protocol()
                client = protocol.client
                if client is None or type(client) is not WireClient:
                    raise Exception("Attempt to setup RDMA without Wireserver")
                client.update_goal_state(forced=True)

                setup_rdma_device()
            except Exception as e:
                logger.error("Error setting up rdma device: %s" % e)
        else:
            logger.info("RDMA capabilities are not enabled, skipping")

        while self.running:
            self.update_handler.run_latest(child_args=child_args)
コード例 #3
0
ファイル: main.py プロジェクト: bingosummer/WALinuxAgent
    def daemon(self, child_args=None):
        logger.info("Run daemon")

        self.protocol_util = get_protocol_util()
        self.scvmm_handler = get_scvmm_handler()
        self.resourcedisk_handler = get_resourcedisk_handler()
        self.rdma_handler = get_rdma_handler()
        self.provision_handler = get_provision_handler()
        self.update_handler = get_update_handler()

        # Create lib dir
        if not os.path.isdir(conf.get_lib_dir()):
            fileutil.mkdir(conf.get_lib_dir(), mode=0o700)
            os.chdir(conf.get_lib_dir())

        if conf.get_detect_scvmm_env():
            self.scvmm_handler.run()

        if conf.get_resourcedisk_format():
            self.resourcedisk_handler.run()

        # Always redetermine the protocol start (e.g., wireserver vs.
        # on-premise) since a VHD can move between environments        
        self.protocol_util.clear_protocol()

        self.provision_handler.run()

        # Enable RDMA, continue in errors
        if conf.enable_rdma():
            self.rdma_handler.install_driver()

            logger.info("RDMA capabilities are enabled in configuration")
            try:
                # Ensure the most recent SharedConfig is available
                # - Changes to RDMA state may not increment the goal state
                #   incarnation number. A forced update ensures the most
                #   current values.
                protocol = self.protocol_util.get_protocol()
                client = protocol.client
                if client is None or type(client) is not WireClient:
                    raise Exception("Attempt to setup RDMA without Wireserver")
                client.update_goal_state(forced=True)

                setup_rdma_device()
            except Exception as e:
                logger.error("Error setting up rdma device: %s" % e)
        else:
            logger.info("RDMA capabilities are not enabled, skipping")

        while self.running:
            self.update_handler.run_latest(child_args=child_args)
コード例 #4
0
    def daemon(self):
        logger.info("Run daemon")

        self.protocol_util = get_protocol_util()
        self.scvmm_handler = get_scvmm_handler()
        self.resourcedisk_handler = get_resourcedisk_handler()
        self.rdma_handler = get_rdma_handler()
        self.provision_handler = get_provision_handler()
        self.update_handler = get_update_handler()

        # Create lib dir
        if not os.path.isdir(conf.get_lib_dir()):
            fileutil.mkdir(conf.get_lib_dir(), mode=0o700)
            os.chdir(conf.get_lib_dir())

        if conf.get_detect_scvmm_env():
            self.scvmm_handler.run()

        if conf.get_resourcedisk_format():
            self.resourcedisk_handler.run()

        # Always redetermine the protocol start (e.g., wireserver vs.
        # on-premise) since a VHD can move between environments
        self.protocol_util.clear_protocol()

        self.provision_handler.run()

        # Enable RDMA, continue in errors
        if conf.enable_rdma():
            self.rdma_handler.install_driver()

            logger.info("RDMA capabilities are enabled in configuration")
            try:
                setup_rdma_device()
            except Exception as e:
                logger.error("Error setting up rdma device: %s" % e)
        else:
            logger.info("RDMA capabilities are not enabled, skipping")

        while self.running:
            self.update_handler.run_latest()
コード例 #5
0
ファイル: main.py プロジェクト: dhuber66/WALinuxAgent
    def daemon(self):
        logger.info("Run daemon")

        self.protocol_util = get_protocol_util()
        self.scvmm_handler = get_scvmm_handler()
        self.resourcedisk_handler = get_resourcedisk_handler()
        self.rdma_handler = get_rdma_handler()
        self.provision_handler = get_provision_handler()
        self.update_handler = get_update_handler()

        # Create lib dir
        if not os.path.isdir(conf.get_lib_dir()):
            fileutil.mkdir(conf.get_lib_dir(), mode=0o700)
            os.chdir(conf.get_lib_dir())

        if conf.get_detect_scvmm_env():
            self.scvmm_handler.run()

        if conf.get_resourcedisk_format():
            self.resourcedisk_handler.run()

        # Always redetermine the protocol start (e.g., wireserver vs.
        # on-premise) since a VHD can move between environments        
        self.protocol_util.clear_protocol()

        self.provision_handler.run()

        # Enable RDMA, continue in errors
        if conf.enable_rdma():
            self.rdma_handler.install_driver()

            logger.info("RDMA capabilities are enabled in configuration")
            try:
                setup_rdma_device()
            except Exception as e:
                logger.error("Error setting up rdma device: %s" % e)
        else:
            logger.info("RDMA capabilities are not enabled, skipping")

        while self.running:
            self.update_handler.run_latest()