...
Always use the existing metadata as the starting point for creating a new object to write. This is because writing metadata will overwrite ALL existing metadata.
Basic examples of API references about working with VM metadata:
...
However, the appropriate and most convenient way to work with VM metadata is using the metadata link!
...
If you ever need to delete the VM metadata, just send a DELETE request to the metadata link. But remember that this request will delete ALL metadata, leaving just the empty links list and the null metadata key, as shown in the first example to retrieve metadata.