removed extra file and updated sql note

This commit is contained in:
Vishvananda Ishaya 2010-09-03 00:53:41 -07:00
parent bc1271761a
commit 22aa51638d
2 changed files with 1 additions and 38 deletions

View File

@ -1,38 +0,0 @@
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Openstack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Duplicates the functionality of euca-describe-instances, but doesn't require
# going through the API. Does a direct query to the datastore. This is
# mostly a test program written for the scheduler
#
"""
List instances by doing a direct query to the datastore
"""
from nova.compute import model
data_needed = ['image_id', 'memory_kb', 'local_gb', 'node_name', 'vcpus']
instances = model.InstanceDirectory().all
for instance in instances:
print 'Instance: %s' % instance['instance_id']
for x in data_needed:
print ' %s: %s' % (x, instance[x])

View File

@ -69,6 +69,7 @@ def service_get_all_compute_sorted(context):
# FROM services LEFT OUTER JOIN
# (SELECT host, count(*) AS instance_count
# FROM instances GROUP BY host) AS inst_count
# ON services.host == inst_count.host
topic = 'compute'
label = 'instance_count'
subq = session.query(models.Instance.host,