X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=vnfs%2FVES5.0%2Fevel%2Fevel-library%2Fcode%2Fevel_library%2Fmetadata.c;h=fceb893c101dc2de26ec96ce91c18e2ba637a2ac;hb=f9cbe4b0ecf250f970cd8ed37b4ba3e9e8af1396;hp=62ea6b5165319968e582b5530011b58f64405a08;hpb=12fd5fcf0e58f79cd4666592dd0fc34090b298e7;p=demo.git diff --git a/vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c b/vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c index 62ea6b51..fceb893c 100644 --- a/vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c +++ b/vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -313,12 +314,30 @@ exit_label: *****************************************************************************/ void openstack_metadata_initialize() { + char hostname[MAX_METADATA_STRING]; + + FILE * f = fopen ("/proc/sys/kernel/random/uuid", "r"); + strncpy(vm_uuid, "Dummy VM UUID - No Metadata available", MAX_METADATA_STRING); strncpy(vm_name, "Dummy VM name - No Metadata available", MAX_METADATA_STRING); + + if( gethostname(hostname, 1024) != -1 ) + strcpy(vm_name,hostname); + + if (f) + { + if (fgets(vm_uuid,MAX_METADATA_STRING, f)!=NULL) + { + vm_uuid[strlen( vm_uuid ) - 1 ] = '\0'; + EVEL_DEBUG("VM UUID: %s", vm_uuid); + } + fclose (f); + } + } /**************************************************************************//**