From 22aa51638dc221e78de60f7e2ddb10eb0ddf4db3 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Fri, 3 Sep 2010 00:53:41 -0700 Subject: removed extra file and updated sql note --- bin/nova-listinstances | 38 -------------------------------------- nova/db/sqlalchemy/api.py | 1 + 2 files changed, 1 insertion(+), 38 deletions(-) delete mode 100755 bin/nova-listinstances diff --git a/bin/nova-listinstances b/bin/nova-listinstances deleted file mode 100755 index 386283d2f..000000000 --- a/bin/nova-listinstances +++ /dev/null @@ -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]) - diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 4ae55eaf4..4fa85b74b 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -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, -- cgit