869 Commits

Author SHA1 Message Date
Mark McLoughlin
82049af90e Refactor away the flags.DEFINE_* helpers
The next obvious step in porting to cfg is to define all options using
cfg schemas directly rather than using the flags.DEFINE_* helpers.

This is a large change, but it is almost entirely pure refactoring and
does not result in any functional changes.

The only change to note is that the default values for glance_host,
glance_api_servers and default_publisher_id options are now using opt
value interpolation i.e.

 -glance_host=_get_my_ip()
 +glance_host='$my_ip'

 -glance_api_servers=['%s:%d' % (FLAGS.glance_host, FLAGS.glance_port)]
 +glance_api_servers=['$glance_host:$glance_port']

 -default_publisher_id=FLAGS.host
 +default_publisher_id='$host'

Also note that the lower_bound check on the {report,periodic}_interval
options are no more, but this has been true since cfg was first added.

Change-Id: Ia58c8f0aaf61628bb55b1b8485118a2a9852ed17
2012-01-28 12:37:16 +00:00
Pádraig Brady
ed6e3efcf6 fix nova-manage image convert exception
* bin/nova-manage (_convert_images): Don't convert
the image id to a number as it's now a uuid.

Change-Id: I4dfe5693d8f394fb9ee3f2c18c7e0b3f2524e931
2012-01-27 20:34:30 +00:00
Jenkins
01a9d86e87 Merge "Fixes bug 921265 - i'nova-manage flavor create|list'" 2012-01-25 22:10:29 +00:00
Dean Troyer
4cdcf1dbff Fixes bug 921265 - i'nova-manage flavor create|list'
These problems were introduced in https://review.openstack.org/2918
* nova-manage needs the change from local_gb to root_gb/ephemeral_gb.
* fixes 'nova-manage flavor ...'
* fixes 'nova-manage service describe_resource ...'

Change-Id: I63040359a425aac3ef7a0a84e6834b1dfe3a8790
2012-01-25 10:36:38 -06:00
Mark McLoughlin
dd29f420ab Remove unused flags.Help*Flag
These don't do anything anymore since we just rely on optparse's
--help behaviour.

Change-Id: I7c74456a06fe924503dcfbcfa4da9fc5c26b8ab0
2012-01-25 13:14:42 +00:00
Vishvananda Ishaya
0c5273c85e Create nova cert worker for x509 support
* Adds new worker for cert management
 * Makes decrypt use an rpc to the worker
 * Moves CA filesystem creation out of cloud.setup
 * Moves test for X509 into crypto
 * Adds test for encrypting and decrypting using cert
 * Cleans up extra code in cloudpipe
 * Fixes bug 918563
 * Prepares for a future patch that will fix bug 903345

Change-Id: I4693c50c8f432706f97395af39e736f49d60e719
2012-01-24 15:10:34 -08:00
Ewan Mellor
4cbf0984f9 Bug #916312: nova-manage network modify --network flag is inconsistent.
Change nova-manage network modify --network to --fixed_range, to match
nova-manage network delete.

Also document both.

Change-Id: I3c03a33e9e3576393252d771eb4ce3353a7f2eaa
2012-01-24 13:41:42 -08:00
Dan Prince
151632ed3a Fixes nova-manage fixed list.
Updates the nova-manage to use db.instance_get_all for instance
information instead of relying on Sqlalchemy model relationships
(which no longer exist due to network refactorings).

This commit fixes 'nova-manage fixed list' so that it correctly
displays hostname, and host. I dropped the MAC address column
which would have required an extra VIF's table lookup and
wasn't used as much.

Fixes LP Bug #920159.

Change-Id: I3cec690c5e40631e0f10b2a914f46863601a1734
2012-01-23 14:54:39 -05:00
Jenkins
28b7107c68 Merge "Fix environment passing in DnsmasqFilter" 2012-01-23 18:26:16 +00:00
Thierry Carrez
bfdb9b1f5e Fix environment passing in DnsmasqFilter
Fix environment passing in DnsmasqFilter so that dnsmasq can
be run as root through nova-rootwrap. Fixes bug 919275.

Change-Id: I2e78d92b9af4ddea9c0f1c5ddbe2d55fb672310e
2012-01-23 13:59:42 +01:00
Dan Prince
b3a41b7229 Fix 'nova-manage config list'
Fixes nova-manage config list to work with the latest flags
implementation in nova Essex. Fixes LP bug #920157.

Change-Id: I3321dc68e4a571354d62836b39f887b0fc2e9877
2012-01-22 15:48:10 -05:00
Dean Troyer
8333a1533c Fix nova-manage floating list (fixes bug 918804)
https://review.openstack.org/2922 broke nova-manage floating list
* Restore db.floating_ip_get_all
* Update instance display in nova-manage

Change-Id: I526237401371a21eafbd9b571f9b4a17a534c1c6
2012-01-20 13:42:12 -06:00
Joe Gordon
88090f212a More cleanup of Imports to match HACKING
Found using https://github.com/cloudscaling/nova-HACKING

Change-Id: Iaf95d7c65d4c6ff1fa4b045d83a4266cc8f27efe
2012-01-19 10:10:41 -08:00
Zhongyue Luo
3a9018e522 chmod nova-logspool
Fixes bug #918612

chmod 775 nova-logspool

Change-Id: I7b773b2058c7180229d2d7b893d3c6aa3b02e4bb
2012-01-19 05:28:32 -05:00
Joe Gordon
236190c452 Cleanup Imports to match HACKING guidelines
found using https://github.com/cloudscaling/nova-HACKING

Change-Id: Ic010f0407e7a139f0f6436af2e72e817c140a4c3
2012-01-18 11:30:22 -08:00
Anthony Young
8d010cacb5 Implements blueprint vnc-console-cleanup
* Creates a unified way to access vnc consoles for xenserver and libvirt
 * Now supports both java and websocket clients
 * Removes nova-vncproxy - a replacement version of this (nova-novncproxy) can be found as described in vncconsole.rst
 * Adds nova-xvpvncproxy, which supports a java vnc client
 * Adds api extension to access java and novnc access_urls
 * Fixes proxy server to close/shutdown sockets more cleanly
 * Address style feedback
 * Use new-style extension format
 * Fix setup.py
 * utils.gen_uuid must be wrapped like str(utils.gen_uuid()) or it can't be serialized

Change-Id: I5e42e2f160e8e3476269bd64b0e8aa77e66c918c
2012-01-17 14:18:31 -08:00
Anthony Young
60ff2e3b72 Implements blueprint separate-nova-volumeapi
* Moves openstack/v2 directory to compute and fixes tests accordingly
 * Moves some code from api/openstack/compute to shared location, for use by volume api
 * Implements basic volume functionality for types, volumes, and snapshots
 * Changes service name from osapi to osapi_compute (and adds osapi_volume)
 * Renames nova-api-os to nova-api-os-compute, adds nove-api-os-volume
 * Separate extension mechanism for compute and volume
 ** Removes flag osapi_extension and replaces with osapi_compute_extension and osapi_volume_extension
 * Updates the paste config
 * Fixes setup.py to include nova-os-api-compute and nova-os-api-volume
 * Fix bug in volume version code that occurred as result of trunk merge
 * Update integrated/test_volumes.py to use new endpoint

Change-Id: I4c2e57c3cafd4e1a9e2ff3ce201c8cf28326afcd
2012-01-13 09:06:55 -08:00
masumotok
8e57055cec First implementation of bp/live-migration-resource-calc
Fix based on revewer's comment

upgraded the migration version
nova/db/sqlalchemy/migrate_repo/versions/069_block_migration.py

rebase on master

Change-Id: Ia762f8dec761c3d595bc6fcd39f127f6d92306d2
2012-01-13 15:24:28 +09:00
Dean Troyer
9e21a2228c nova-manage floating ip fixes
* Add pool, interface to 'floating list' output
  These columns were added to the floating_ips table in
  https://review.openstack.org/2892 and are not visible elsewhere
* Fix 'floating delete' to skip network/broadcast addresses
  Makes the delete command match the create command behaviour
  introduced in https://review.openstack.org/2663
* Address changes listed in bug 817281
  Change host column in output to project ID, change hostname
  column to uuid

Change-Id: Ibbfbe9ed5543927a6b2a1e676f5617901a32f897
2012-01-10 16:51:06 -06:00
Vishvananda Ishaya
26b24b7e23 Adds support for floating ip pools
* Implements blueprint multiple-floating-ip-ranges
 * Adds pool and interface fields to floating ip tables
 * Adds extension to get a list of available pools
 * Optionally allows a pool to be specified when allocating
 * Changes nova-manage command to allow pool and interface
 * Ip binding uses the interface from table instead of flag
 * Adds default pool flag to use when pool is not specified
 * updates test to work with new fields
 * adds tests for extension

Change-Id: Ieb4cbbf07b211697d08178b1cf2252caf75049a2
2012-01-09 13:18:02 -08:00
lzyeval
88ccade9d5 PEP8 type comparison cleanup
Fixes bug #910295

The None, True, and False values are singletons.

All variable *comparisons* to singletons should use 'is' or 'is not'.
All variable *evaluations* to boolean should use 'if' or 'if not'.

"== None", "== True", "== False", and "!= None" comparisons in sqlalchemy's
where(), or_(), filter(), and_(), and select() functions should not be changed.

Incorrect comparisons or evaluations in comments were not changed.

Change-Id: I087f0883bf115b5fe714ccfda86a794b9b2a87f7
2012-01-04 07:32:13 +08:00
lzyeval
ae1654bc59 PEP8 remove direct type comparisons
Fixes bug #910763

According to PEP8,
- Object type comparisons should always use isinstance() instead
      of comparing types directly.

        Yes: if isinstance(obj, int):

        No: if type(obj) is type(1):

      When checking if an object is a string, keep in mind that it might be a
      unicode string too! In Python 2.3, str and unicode have a common base
      class, basestring, so you can do:

        if isinstance(obj, basestring):

Change-Id: I7c0fdecf99872f5b8f72b2c2ed4f5c539c33def1
2012-01-03 11:12:42 +08:00
Jenkins
b9500ff068 Merge "Bug 820059: bin/nova-manage.py VpnCommands.spawn calls non-existant method VpnCommands._vpn_for - fixed" 2011-12-29 18:44:19 +00:00
Jenkins
fee0b1e53d Merge "Bug 751229: Floating address range fixed" 2011-12-29 18:16:42 +00:00
Ivan Kolodyazhny
c9393f76a3 Bug 820059: bin/nova-manage.py VpnCommands.spawn calls non-existant method VpnCommands._vpn_for - fixed
Change-Id: I86c509d98fac685a5d658f397d0672f71b4bc175
2011-12-29 11:24:52 +02:00
Ivan Kolodyazhny
135fd91916 Bug 751229: Floating address range fixed
Change-Id: I4c7ab8512fe3a00dd555d3a183b2c2348cef9e21
2011-12-29 09:20:58 +02:00
Joe Gordon
4ea63c4021 Brings some more files up to HACKING standards
Change-Id: I738fb70d49dade90d31e8c848fa841497083e9b4
2011-12-28 18:11:59 -08:00
Julien Danjou
605dfa9dee Fix nova-manage flags declaration
Some flags seem not used anymore, whereas some are not correctly declared
and would fail.

Change-Id: I8fd0ad949fd9a4b932e8e31d28e6e9dc5426bb28
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2011-12-15 17:31:51 +01:00
Julien Danjou
36791875b5 Remove useless flags declaration
Change-Id: I326d0b7a8690dd392d089b792085c38825a55861
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2011-12-15 17:04:27 +01:00
Dean Troyer
bfee1661f6 Follow-on to I665f402f to convert rxtx_quota to rxtx_factor in
nova-manage and a couple of tests.

Change-Id: I1c72dbef6173e4c08006e36fa90565a724528b7c
2011-12-13 15:23:31 -06:00
Jenkins
10c829ff39 Merge "Add ability to see deleted and active records." 2011-12-08 23:01:27 +00:00
Rick Harris
c40ee5cfe7 Add ability to see deleted and active records.
Fixes bug #900564

Changes `Context`.`read_deleted` from a bool to an enum string with values
"yes" (can read deleted records), "no" (cannot read deleted records), and
"only" (can only see deleted records, for backwards compatibility).

Change-Id: Ic81db3664c33f23f751b73973782efb06fce90d9
2011-12-07 16:06:31 -06:00
Thierry Carrez
3c87de7c12 A more secure root-wrapper alternative
Alternative to using a sudoers file to limit which commands can be run as
root in Nova. This one makes use of command filters defined in Nova code
itself, which can be customized to deeply inspect command arguments before
allowing a command to be executed.

This change puts the infrastructure in place, together with command filters
that replicate the level of filtering provided by a sudoers file (no deep
argument inspection yet). An example of an advanced filter (RegExpFilter) is
also provided. This new root wrapper is not active by default (root_helper
still defaults to "sudo"). Implements blueprint nova-rootwrap.

Change-Id: I7ad723b55e9446758876f21b4fbb09374a910425
2011-12-07 15:10:04 +01:00
Ghe Rivero
2c438f55be Updated nova-manage to work with uuid images
Fixes bug 899299

Change-Id: Ib0be692503b8761a5600902a1e0d7a4dc371a680
2011-12-05 16:59:31 +01:00
Ewan Mellor
2f70137a1b Bug #897054: stack crashes with AttributeError on e.reason if the server returns an error
Swap the URLError and HTTPError exception handlers.  HTTPError is a subclass
of URLError, so the HTTPError handler wasn't being reached.

Change-Id: Iec86d2b345dbd37858af888bbd54a74884025eda
2011-11-27 20:14:40 -08:00
Vishvananda Ishaya
e6073532e5 Separate metadata api into its own service
part 1 of blueprint separate-nova-metadata

 * adds api/metadata/ and moves code from ec2
 * moves metadata into separate binary
 * changes metadata forward to use metadata host and port
 * moves the metadata accept rule to the metadata api
 * adds nova-api-* to setup.py

Change-Id: I7f5d8e6cafc55b5c383cd88991f29c6059fb8d82
2011-11-15 13:27:58 -08:00
Jenkins
31b5f88a18 Merge "Stop nova-ajax-console-proxy configuring its own logging." 2011-11-12 17:30:16 +00:00
Ewan Mellor
d7e5a79150 nova-manage: exit with status 1 if an image registration fails
This indicates the failure to the user through the exit status.

Original author: Renuka Apte <renuka.apte@citrix.com>

Change-Id: I73fc2cc35530e7ee7f113f5aaec7b577663e4dc1
2011-11-10 12:13:04 -08:00
Jenkins
67c559a3f5 Merge "Bug #884018: "stack help" prints stacktrace if it cannot connect to the server" 2011-11-09 15:06:09 +00:00
Brad Hall
38172d5587 Add DHCP support to the QuantumManager and break apart dhcp/gateway
This introduces a new flag "quantum_use_dhcp=<boolean>" which indicates whether
or not to enable dhcp for all of the networks.  If it is set then we start
dnsmasq (and provide it with the IP/MACs from Melange) similar to how this was
done in linux_net before.

Prior to this if you enabled dhcp then you would also get a gateway device..
some people may not want that so we now require that you specify the gateway
when creating the network in order to end up with a device that will act as a
gateway.  If you're using Melange IPAM and you don't specify the gateway you
still end up with one because it doesn't allow you to not have one.  This lays
the groundwork for the option of not having one in the future, at least :)

Also, fix quantum/melange ipam interaction

We now query for the subnets by net_id/vif_id instead of searching through all
the blocks to find the right one.  Both of the allocate and deallocate for
instance calls are now using the vif_id -> network_id mapping instead of
searching the quantum networks.  get_port_by_attachment was also changed to
take a net_id so that we don't have to search through all of the quantum
networks to find the corresponding port.

Change-Id: I6a84da35237b6c5f5cdee91ada92642103439a97
2011-11-04 20:11:53 -07:00
Brad Hall
c32258c77d Change network delete to delete by uuid or cidr
With melange it will be possible to have overlapping cidrs so it would be
better to specify the uuid of the network to delete.

Change-Id: I6781225d587952cbab3387cd40164d8ac77c58d6
2011-11-04 15:00:21 -07:00
garyk
813794ed46 Blueprint lasterror
Add in a log report to nova-manage

Usages:

Get the last errors in the nova logs
    nova-manage logs errors

Get the last x nova messages in the syslog. The default is 10
    nova-manage logs syslog <x>

Change-Id: Id5d3a546051e25175b6523711f437618d07c3f19
2011-11-08 16:50:46 +02:00
Jenkins
67a1c257f9 Merge "Set nova-manage to executable Fixes LP885778" 2011-11-04 14:31:14 +00:00
Jenkins
c978bcab84 Merge "Log the exception when we get one." 2011-11-04 14:21:56 +00:00
Jason Kölker
a032825eb4 Set nova-manage to executable
Fixes LP885778

Change-Id: I0d78d91e4e93183848aa287007caa7027a751e65
2011-11-03 12:07:43 -05:00
Jenkins
ee515c588c Merge "Bug #884534: nova-ajax-console-proxy crashes on shutdown" 2011-11-03 15:26:13 +00:00
renukaapte
931a0e2068 Xen Storage Manager Volume Driver
For details, please read the full specification here:
http://wiki.openstack.org/xenapi-sm-volume-driver

Change-Id: I17028a491d8ddee465bfa920907fe3bcaa911869
2011-11-01 16:16:09 -07:00
Ewan Mellor
6fa7fa4025 Stop nova-ajax-console-proxy configuring its own logging.
nova-ajax-console-proxy is overriding the logging configuration carefully
set up by nova.log.  There's no reason for it to do this, and it's the only
script in nova/bin that does.  I've removed that code.

Change-Id: I5b2d5026d529a20d26ba3bb721b15f235f6fdda8
2011-11-01 12:29:23 -07:00
Ewan Mellor
46152102a0 Log the exception when we get one.
Change-Id: Iee478c8f300b608dd153e3400bd17866f52543c5
2011-11-01 11:33:44 -07:00
Ewan Mellor
826888de03 Bug #884534: nova-ajax-console-proxy crashes on shutdown
Close the correct connection, when shutting down.  self is not defined in
this context.

Change-Id: I0dc84a1c7de468a381f5765ccba589acbc8173dd
2011-10-31 17:33:47 -07:00