Beispiel #1
0
def _libVirtDiscover(result, verbose=0):
    """
    Discover all nodes in the network that are available through 
    the libVirt Python api.  While a separate library from use in OpenStack,
    we mainly only care about VM instances spawned by OpenStack
    
    TODO: This will change radically, for now, just do some hardcoded calls
          to various interfaces and see what is available.  Evenutally this
          will be consolidated once patterns emerge.
    """
    virtDisc.discover(result, verbose)
Beispiel #2
0
def discover(verbose=0):
    """
    Discover all nodes in the network that are available through 
    OpenStack APIs
    
    TODO: This will change radically, for now, just do some hardcoded calls
          to various interfaces and see what is available.  Evenutally this
          will be consolidated once patterns emerge.
    """

    # TODO: Call into any needed APIs

    print "TODO: Openstack: Discover"

    result = {}
    result["libvirt"] = {}
    result["neutron"] = {}
    result["libvirt"] = {}

    # Discover information an any running instances

    _libVirtDiscover(result["libvirt"], verbose=verbose)

    # Discover any exising network config from the Neutron network service

    _neutronDiscovery(result["neutron"], verbose=verbose)

    # Discover any running virtual instances

    virtDisc.discover(result["libvirt"], verbose=verbose)

    # Pretty print for debug now

    pp = pprint.PrettyPrinter(indent=2)
    pp.pprint(result)

    # nova.discoverAll()

    return result