osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[openstacksdk][nova] distinguish image and boot from volume instances


Hey,

I wrote a function for distinguishing an image instance from an boot from
volume instance for billing purpose.

But it does not work this way, it seems as if BfV Instances also have the
Image property set.

Is there an elegant solution other than analyzing the volume attachment
state?

This cloud be a problem, because an image instance cloud also have volumes.

 

def getBootFromVolInstances(serverId):

    '''Determines wether an instance is a boot frome volume instance'''

    server = conn.compute.find_server(serverId, ignore_missing=True)

    if server:

        if server.image:

            return False

        else:

            return True

    return False

 

Merlin Blom

Cloud System Engineer

E-Mail:  <mailto:merlin.blom at bertelsmann.de> merlin.blom at bertelsmann.de

 <https://www.arvato-systems.de> arvato-systems.de

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20191213/ceb56d45/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5195 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20191213/ceb56d45/attachment-0001.bin>