'Delete the given metadata item from an instance.'

@check_instance_lock
@check_instance_state(vm_state=[vm_states.ACTIVE, vm_states.PAUSED, vm_states.SUSPENDED, vm_states.STOPPED], task_state=None)
def delete_instance_metadata(self, context, instance, key):

    instance.delete_metadata_key(key)
    self.compute_rpcapi.change_instance_metadata(context, instance=instance, diff={key: ['-']})
