summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTushar Patil <tushar.vitthal.patil@gmail.com>2011-08-23 02:05:35 +0000
committerTarmac <>2011-08-23 02:05:35 +0000
commitc2fb9485f956482a5e6d628bb80e86d3e8d90d3a (patch)
tree28a12d89b20beee54fb6378da562306d7441563f /bin
parent4e987a070ad3d50d2b47a894029f981168bacd1f (diff)
parent4ded14d0d8fb4ec1bbc14255e90cbaae0626997f (diff)
downloadnova-c2fb9485f956482a5e6d628bb80e86d3e8d90d3a.tar.gz
Our goal is to add optional parameter to the Create server OS 1.0 and 1.1 API to achieve following objectives:-
1) Specify number and order of networks to the create server API. In the current implementation every instance you launch for a project having 3 networks assigned to it will always have 3 vnics. In this case it is not possible to have one instance with 2 vnics ,another with 1 vnic and so on. This is not flexible enough and the network resources are not used effectively. 2) Specify fixed IP address to the vnic at the boot time. When you launch a server, you can specify the fixed IP address you want to be assigned to the vnic from a particular network. If this fixed IP address is already in use, it will give exception. Example of Server Create API request XML: <?xml version="1.0" encoding="UTF-8"?> <server xmlns="http://docs.nttpflab.com/servers/api/v1.0"         name="new-server-test" imageId="1" flavorId="1">   <metadata>     <meta key="My Server Name">Apache1</meta>   </metadata>   <personality>     <file path="/etc/banner.txt">         ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp     </file>   </personality>   <networks>       <network uuid="6622436e-5289-460f-8479-e4dcc63f16c5" fixed_ip="10.0.0.3">       <network uuid="d97efefc-e071-4174-b6dd-b33af0a37706" fixed_ip="10.0.1.3">   </networks> </server> 3) Networks is an optional parameter, so if you don't provide any networks to the server Create API, it will behave exactly the same as of today. This feature is supported to all of the network models.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-manage35
1 files changed, 19 insertions, 16 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index 3d9a40afb0..1b29d71963 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -765,23 +765,26 @@ class NetworkCommands(object):
def list(self):
"""List all created networks"""
- print "%-18s\t%-15s\t%-15s\t%-15s\t%-15s\t%-15s\t%-15s" % (
- _('IPv4'),
- _('IPv6'),
- _('start address'),
- _('DNS1'),
- _('DNS2'),
- _('VlanID'),
- 'project')
+ _fmt = "%-5s\t%-18s\t%-15s\t%-15s\t%-15s\t%-15s\t%-15s\t%-15s\t%-15s"
+ print _fmt % (_('id'),
+ _('IPv4'),
+ _('IPv6'),
+ _('start address'),
+ _('DNS1'),
+ _('DNS2'),
+ _('VlanID'),
+ _('project'),
+ _("uuid"))
for network in db.network_get_all(context.get_admin_context()):
- print "%-18s\t%-15s\t%-15s\t%-15s\t%-15s\t%-15s\t%-15s" % (
- network.cidr,
- network.cidr_v6,
- network.dhcp_start,
- network.dns1,
- network.dns2,
- network.vlan,
- network.project_id)
+ print _fmt % (network.id,
+ network.cidr,
+ network.cidr_v6,
+ network.dhcp_start,
+ network.dns1,
+ network.dns2,
+ network.vlan,
+ network.project_id,
+ network.uuid)
@args('--network', dest="fixed_range", metavar='<x.x.x.x/yy>',
help='Network to delete')