AFIR the metadata is read by a init script inside the instance, not the cartridge agent. In EC2 and Openstack we can pass the user data using jclouds API. However it can not be done in VCloud scenario. In VCloud custom metadata can be stored in VApp. However in order retrieve username/password are needed.
I'v written to some blog post where they suggest to go via script as Isuru is trying. Touched, not typed. Erroneous words are a feature, not a typo.