Exemplo n.º 1
0
 def stop(self, experiment_id, need_status):
     template_framework = TemplateFramework(experiment_id)
     for template_unit in template_framework.get_template_units():
         # stop virtual machine
         run_job(MDL_CLS_FUNC[17],
                 (self.azure_key_id, ),
                 (experiment_id, template_unit, need_status))
Exemplo n.º 2
0
 def start(self, experiment_id):
     template_framework = TemplateFramework(experiment_id)
     for template_unit in template_framework.get_template_units():
         # start virtual machine
         run_job(MDL_CLS_FUNC[21],
                 (self.azure_key_id, ),
                 (experiment_id, template_unit))
Exemplo n.º 3
0
 def create(self, experiment_id):
     template_framework = TemplateFramework(experiment_id)
     for template_unit in template_framework.get_template_units():
         # create storage account
         run_job(MDL_CLS_FUNC[0],
                 (self.azure_key_id, ),
                 (experiment_id, template_unit))
Exemplo n.º 4
0
    def start_vm_entry(self, context):
        """

        :param context: azure_key_id, experiment_id,
        :return:
        """
        template_framework = TemplateFramework(context.experiment_id)
        for template_unit in template_framework.get_template_units():
            # start virtual machine
            context.template_unit = template_unit
            self.scheduler.add_once(feature='azure_vm_service',
                                    method='start_virtual_machine',
                                    context=context,
                                    seconds=3)
Exemplo n.º 5
0
    def start_vm_entry(self, context):
        """

        :param context: azure_key_id, experiment_id,
        :return:
        """
        template_framework = TemplateFramework(context.experiment_id)
        for template_unit in template_framework.get_template_units():
            # start virtual machine
            context.template_unit = template_unit
            self.scheduler.add_once(feature='azure_vm_service',
                                    method='start_virtual_machine',
                                    context=context,
                                    seconds=3)
Exemplo n.º 6
0
    def create_vm_for_expr_entry(self, context):
        """create a vm when needed for expr_mangement

        callable logic : create storage account -> create cloud service -> cretae virtual machine

        :param context : contains azure_key_id, experiment_id
        :return:
        """
        template_framework = TemplateFramework(context.experiment_id)
        for template_unit in template_framework.get_template_units():
            # create storage account
            context.template_unit = template_unit
            self.scheduler.add_once(feature='azure_storage_account_service',
                                    method='create_storage_account',
                                    context=context,
                                    seconds=3)
Exemplo n.º 7
0
    def create_vm_for_expr_entry(self, context):
        """create a vm when needed for expr_mangement

        callable logic : create storage account -> create cloud service -> cretae virtual machine

        :param context : contains azure_key_id, experiment_id
        :return:
        """
        template_framework = TemplateFramework(context.experiment_id)
        for template_unit in template_framework.get_template_units():
            # create storage account
            context.template_unit = template_unit
            self.scheduler.add_once(feature='azure_storage_account_service',
                                    method='create_storage_account',
                                    context=context,
                                    seconds=3)
Exemplo n.º 8
0
    def stop_vm_entry(self, context):
        """

        :param context:
                        azure_key_id,
                        experiment_id,
                        action: AVMStatus.STOPPED or AVMStatus.STOPPED_DEALLOCATED
        :return:
        """
        template_framework = TemplateFramework(context.experiment_id)
        for template_unit in template_framework.get_template_units():
            # stop virtual machine
            context.template_unit = template_unit
            self.scheduler.add_once(feature='azure_vm_service',
                                    method='stop_virtual_machine',
                                    context=context,
                                    seconds=3)
Exemplo n.º 9
0
    def stop_vm_entry(self, context):
        """

        :param context:
                        azure_key_id,
                        experiment_id,
                        action: AVMStatus.STOPPED or AVMStatus.STOPPED_DEALLOCATED
        :return:
        """
        template_framework = TemplateFramework(context.experiment_id)
        for template_unit in template_framework.get_template_units():
            # stop virtual machine
            context.template_unit = template_unit
            self.scheduler.add_once(feature='azure_vm_service',
                                    method='stop_virtual_machine',
                                    context=context,
                                    seconds=3)