def validate(self):
        utils.check_server_status(self.inst_id, expected_task=utils.tasks.InstanceTasks.NONE,
                                  expected_svr_status=utils.ServiceStatuses.RUNNING,
                                  deleted=False)
        inst_db_info = utils.get_instance(self.inst_id)
        self.group_id = inst_db_info.group_id

        utils.check_mysql_adminuser(inst_db_info.id)
        
        _ret = utils.get_builtin_instance(inst_db_info.id)
        self.nova_instance = _ret.server
        
#         ip = utils.check_allocate_ip(self.nova_instance)
        utils.check_mysql_is_running(inst_db_info.id)
        utils.check_vip(inst_db_info.id)
        
        self.backup_id = utils.check_backup(self.group_id)
        utils.check_backup_status(self.backup_id)
        utils.check_backup_path(self.backup_id)
        
        utils.check_rpl_topo_single(self.group_id)
 def validate(self):
     utils.check_server_status(self.inst_id, expected_task=utils.tasks.InstanceTasks.NONE,
                               type=DBInstanceType.MASTER,
                               expected_svr_status=utils.ServiceStatuses.RUNNING,
                               deleted=False, timeout=600)
     
     utils.check_server_status(self.dbslave_id, expected_task=utils.tasks.InstanceTasks.NONE,
                               type=DBInstanceType.STANDBY,
                               expected_svr_status=utils.ServiceStatuses.RUNNING,
                               deleted=False, timeout=600)
     
     rr_items = InstanceGroupItem.get_by_gid_type(utils.get_context(), self.group_id, DBInstanceType.READ_REPLI, deleted = False)
     slave_ids = []
     for rr in rr_items:
         slave_ids.append(rr.instance_id)
     slave_ids.append(self.dbslave_id)
     
     utils.check_mysql_adminuser(self.inst_id)
     utils.check_mysql_adminuser(self.dbslave_id)
     
     for _id in [self.inst_id, self.dbslave_id]:
         utils.check_mysql_is_running(self.inst_id)
     
     utils.check_vip(self.inst_id, vip_id=self.vip_id)
     self.backup_id = utils.check_backup(self.group_id)
     utils.check_backup_status(self.backup_id) 
     utils.check_backup_path(self.backup_id)
     
     for slave_id in slave_ids:
         utils.check_rpl_delay(slave_id)
         
     master_inst = utils.get_builtin_instance(self.inst_id)
     slave_inst = utils.get_builtin_instance(self.dbslave_id)
     master_ip = utils.check_allocate_ip(master_inst.server)
     slave_ip = utils.check_allocate_ip(slave_inst.server)
     LOG.info("master_ip:%s  slave_ip:%s" % (master_ip, slave_ip))
     utils.check_rpl_consist(self.inst_id, slave_ids, master_ip, [slave_ip])
     utils.check_rpl_topo_ha(self.group_id)