def _get_guest_config_meta(self, context, instance, flavor):
    'Get metadata config for guest.'
    meta = vconfig.LibvirtConfigGuestMetaNovaInstance()
    meta.package = version.version_string_with_package()
    meta.name = instance['display_name']
    meta.creationTime = time.time()
    if (instance['image_ref'] not in ('', None)):
        meta.roottype = 'image'
        meta.rootid = instance['image_ref']
    if (context is not None):
        ometa = vconfig.LibvirtConfigGuestMetaNovaOwner()
        ometa.userid = context.user_id
        ometa.username = context.user_name
        ometa.projectid = context.project_id
        ometa.projectname = context.project_name
        meta.owner = ometa
    fmeta = vconfig.LibvirtConfigGuestMetaNovaFlavor()
    fmeta.name = flavor.name
    fmeta.memory = flavor.memory_mb
    fmeta.vcpus = flavor.vcpus
    fmeta.ephemeral = flavor.ephemeral_gb
    fmeta.disk = flavor.root_gb
    fmeta.swap = flavor.swap
    meta.flavor = fmeta
    return meta
Get metadata config for guest.
def _get_guest_config_meta(self, context, instance, flavor):
    
    meta = vconfig.LibvirtConfigGuestMetaNovaInstance()
    meta.package = version.version_string_with_package()
    meta.name = instance['display_name']
    meta.creationTime = time.time()
    if (instance['image_ref'] not in (, None)):
        meta.roottype = 'image'
        meta.rootid = instance['image_ref']
    if (context is not None):
        ometa = vconfig.LibvirtConfigGuestMetaNovaOwner()
        ometa.userid = context.user_id
        ometa.username = context.user_name
        ometa.projectid = context.project_id
        ometa.projectname = context.project_name
        meta.owner = ometa
    fmeta = vconfig.LibvirtConfigGuestMetaNovaFlavor()
    fmeta.name = flavor.name
    fmeta.memory = flavor.memory_mb
    fmeta.vcpus = flavor.vcpus
    fmeta.ephemeral = flavor.ephemeral_gb
    fmeta.disk = flavor.root_gb
    fmeta.swap = flavor.swap
    meta.flavor = fmeta
    return meta