def UpdateInstanceMetadata(compute, instance, zone, project, new_metadata):
    """Update the instance metadata."""
    cmd = compute.instances().setMetadata(
        instance=instance, project=project, zone=zone, body=new_metadata
    )
    return cmd.execute()