Esempio n. 1
0
 def _delete_RRs(self):
     rids = self._get_rids()
     
     orig_rid_vips = {}
     for rid in rids:
         vip_id = utils.get_vip_id(rid, deleted = False)
         orig_rid_vips[rid] = vip_id
         
     
     for rid in rids:
         utils.check_server_status(rid,expected_task=utils.tasks.InstanceTasks.NONE,
                                   type=DBInstanceType.READ_REPLI,
                                   expected_svr_status=utils.ServiceStatuses.RUNNING,
                                   deleted=False,timeout=10)
         
         utils.delete_rds_byclient(rid)
         utils.check_server_status(rid,expected_task=utils.tasks.InstanceTasks.NONE,
                                   type=DBInstanceType.READ_REPLI,
                                   expected_svr_status=utils.ServiceStatuses.DELETED,
                                   deleted=True,timeout=CONF.nova_delete_timeout)
         
         vip_id = utils.get_vip_id(rid)
         utils.check_vip(rid, vip_id=vip_id, deleted=True)
         
         # Fore. 20150615. Delete One RR Instance will not make change to other RR Instance's VIP-RIP mapping.
         orig_rid_vips.pop(rid)
         for k, v in orig_rid_vips.items():
             utils.check_vip(id = k, vip_id = v, deleted = False)
Esempio n. 2
0
    def delete(self):
        self.inst_id = utils.get_instance_id_bytenant(DBInstanceType.SINGLE)
        _master_vm_id = utils.get_instance(self.inst_id).compute_instance_id

        utils.delete_rds_byclient(self.inst_id)
        utils.check_vm_is_running(_master_vm_id, expect_status="DELETED", timeout=CONF.nova_delete_timeout)
        
        utils.check_server_status(self.inst_id, expected_task=utils.tasks.InstanceTasks.NONE,
                                  expected_svr_status=utils.ServiceStatuses.DELETED,
                                  deleted=True, timeout=CONF.nova_delete_timeout)
        
        utils.check_vip(self.inst_id, deleted=True)
Esempio n. 3
0
 def _validate(self, master_id, validated_inst_id):
     utils.check_server_status(validated_inst_id,expected_task=utils.tasks.InstanceTasks.NONE,
                               type=DBInstanceType.READ_REPLI,
                               expected_svr_status=utils.ServiceStatuses.RUNNING,
                               deleted=False,timeout=300)
     
     utils.check_mysql_adminuser(validated_inst_id)
     utils.check_vip(master_id)
     vip_id = utils.get_vip_id(validated_inst_id)
     utils.check_vip(validated_inst_id,vip_id=vip_id)
 
     utils.check_rpl_delay(validated_inst_id)
     
     master_ip = utils.check_allocate_ip(utils.get_builtin_instance(master_id).server)
     rr_ip = utils.check_allocate_ip(utils.get_builtin_instance(validated_inst_id).server)
     
     utils.check_rpl_consist(master_id, [validated_inst_id],master_ip,[rr_ip])
     utils.check_rpl_topo_rr(self.group_id)
Esempio n. 4
0
    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)
Esempio n. 5
0
 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)