Over the years there has been a lot of changes in metadata in vCloud director,so am going to give te difference between the metadata in vCloud director 5.1 and the previous ones.
The difference is:
- Typed values-in the latest update it must be put into a certain type, on random metadata entry.
- Domain and visibility-it has been made such that providers can now provide system metadata entries on objects that are not visible to users. Additionally the providers can make the metadata private thus the users cannot see the system metadata on the object at all.
- Objects –metadata can now be be added to new vCloud Director 5.1 objects, including disks and storage. vCloud users can add their own metadata to networks because OrgVDC networks are now user manageable.
If you are more interested in metadata you can read it at working with object metadata in the vCloud programming guide.
I took the liberty of providing a powerCLI 5.1 R2 example:
$vapp = Get-CIVapp “MyVApp”
$metadata = $vapp.extensiondata.GetMetadata()
$metadata.MetadataEntry = New-Object VMware.VimAutomation.Cloud.Views.MetadataEntry
# I don’t have any other metadata, so index is [0].
$metadata.MetadataEntry[0].Key = “Jake”
$metadata.MetadataEntry[0].TypedValue = New-Object VMware.VimAutomation.Cloud.Views.MetadataStringValue
$metadata.MetadataEntry[0].TypedValue.Value = “vCloudNerd”
$vapp.ExtensionData.CreateMetadata($metadata)