'Confirms a migration/resize and deletes the \'old\' instance.'

@check_instance_lock
@check_instance_cell
@check_instance_state(vm_state=[vm_states.RESIZED])
def confirm_resize(self, context, instance, migration=None):

    elevated = context.elevated()
    if (migration is None):
        migration = objects.Migration.get_by_instance_and_status(elevated, instance.uuid, 'finished')
    migration.status = 'confirming'
    migration.save()
    self._record_action_start(context, instance, instance_actions.CONFIRM_RESIZE)
    self.compute_rpcapi.confirm_resize(context, instance, migration, migration.source_compute)
