Ejemplo n.º 1
0
    def __init__(self, service_name = config.service_name, deployment_name = config.deployment_name, role_name = config.role_name, affinity_group = config.affinity_group, num = 0):
        # static data
        self.subscription_id = config.subscription_id
        self.pem_path = config.pem_path
        self.service_name = service_name
        self.deployment_name = deployment_name
        self.role_name = role_name
        self.location = config.location
        self.media_name = config.media_name
        self.media_link_base = config.media_link_base
        self.computer_name = config.computer_name
        self.username = config.username
        self.password = config.password
        self.endpoint = config.endpoint
        self.role_size = config.role_size
        self.affinity_group = affinity_group
        self.endpoint_list = config.endpoint_list
        self.SERVICE_CERT_THUMBPRINT = config.SERVICE_CERT_THUMBPRINT
        self.SERVICE_CERT_DATA = config.SERVICE_CERT_DATA
        self.SERVICE_CERT_FORMAT = config.SERVICE_CERT_FORMAT
        self.SERVICE_CERT_PASSWORD = config.SERVICE_CERT_PASSWORD
        self.num = num

        self.sms = ServiceManagementService(self.subscription_id, self.pem_path)
        # config OS
        self.config_OS()
        # config network
        self.config_network(util.is_controller(self.num))
Ejemplo n.º 2
0
 def run(self):
     for i in range(util.retry_times):
         if self.createVM_instance.deleteVM():
             break
     if util.is_controller(self.num):
         for i in range(util.retry_times):
             if self.createVM_instance.delete_hosted_service():
                 break
 def run(self):
     for i in range(util.retry_times):
         if self.createVM_instance.deleteVM():
             break
     if util.is_controller(self.num):
         for i in range(util.retry_times):
             if self.createVM_instance.delete_hosted_service():
                 break
Ejemplo n.º 4
0
 def createVM(self):
     try:
         if not util.is_controller(self.num):
             if self.add_role_instance() == False:
                 return False
         # start role 
         props = self.sms.get_deployment_by_name(self.service_name, self.deployment_name)
         if self._get_role_instance_status(props, self.role_name) != "ReadyRole":
             self.sms.start_role(self.service_name, self.deployment_name, self.role_name)
         self._wait_for_role_instance_status(self.service_name, self.deployment_name, self.role_name, 'ReadyRole')
         return True
     except Exception as e:
         print e
         return False
Ejemplo n.º 5
0
 def prepare(self):
     if util.is_controller(self.num):
         for i in range(util.retry_times):
             if self.createVM_instance.delete_deployment():
                 break
Ejemplo n.º 6
0
 def prepare(self):
     if util.is_controller(self.num):
         for i in range(util.retry_times):
             if self.createVM_instance.create_first_VM():
                 break
 def prepare(self):
     if util.is_controller(self.num):
         for i in range(util.retry_times):
             if self.createVM_instance.delete_deployment():
                 break
 def prepare(self):
     if util.is_controller(self.num):
         for i in range(util.retry_times):
             if self.createVM_instance.create_first_VM():
                 break