3542 Commits

Author SHA1 Message Date
Jenkins
9b24d29ee6 Merge "Update cfg from openstack-common" 2012-02-07 23:53:42 +00:00
Mark McLoughlin
68b25c2a83 Update cfg from openstack-common
Use openstack-common's update.py script to pull in some recent changes:

 * Add the Mapping interface to cfg.ConfigOpts
 * Add support to cfg for disabling interspersed args

Make use of both of these in nova/flags.py.

Add some dire warnings to HACKING about directly modifying the copy of
openstack-common code. I'm confident they won't be ignored :-)

Change-Id: I7ef75d18922c0bbb8844453b48cad0418034bc11
2012-02-07 21:35:30 +00:00
Jenkins
0f3995d3cf Merge "Fix support for --flagfile argument" 2012-02-07 16:50:12 +00:00
Johannes Erdfelt
829e2126d1 Fix support for --flagfile argument
Recent changes broke support for the --flagfile argument. It would attempt
to find the argument and then pull off the filename portion, but it would
only skip one letter, instead of the full argument name. The resulting
error would be:

Change-Id: Ic252b0c778774a7ea3e24a9ed8b182deb5987f65
OSError: [Errno 2] No such file or directory: 'lagfile=../nova.conf'
2012-02-07 15:49:13 +00:00
Jenkins
4ed27f44ba Merge "Fix _poll_bandwidth_usage if no network on vif" 2012-02-06 23:59:01 +00:00
Jason Kölker
9ef4661dbe Fix _poll_bandwidth_usage if no network on vif
Bugfix for lp901819

Move DB lookups out of the virt layer for bw usage.
Migrate to storing the mac address in the table.
Only lookup network label when sending usage events.
Attempt to use info_cache for label lookup before
    punting to rpc call.

Change-Id: Iffb4bc220804be7d5fe26d6416b90cd747b72753
2012-02-06 17:03:07 -06:00
Jenkins
7b0f0e97c7 Merge "Allows nova to read files as root" 2012-02-06 17:18:45 +00:00
Vishvananda Ishaya
7415aaea3e Allows nova to read files as root
* Adds a rootwrap filter to limit readable files
 * Adds a utils method to read a file as root
 * adds tests to verify the additions work

Change-Id: Ic1ffb6f72f9b73795d5f39fac719842e6bdf16dd
2012-02-03 16:49:42 -08:00
Soren Hansen
7603fbc93a Re-run nova-manage under sudo if unable to read conffile
Having to manually sudo to the nova user to make things work is
tedious. Make it so that if we can't read the conffile, we just
re-exec under sudo.

Fixes bug 805695

Change-Id: I322cece80ca757c69147fb3f8474ad137d9bff82
2012-02-04 00:26:26 +01:00
Jenkins
9522ec7943 Merge "Move cfg to nova.openstack.common" 2012-02-03 19:50:45 +00:00
Mark McLoughlin
fce2bf3cba Move cfg to nova.openstack.common
Move it here so that it can be kept in sync with openstack-common using
the new update.py script for code in openstack-common's incubation area.

See here for more details:

  http://wiki.openstack.org/CommonLibrary#Incubation

Note: this commit just moves the existing code in Nova with no other
changes. A subsequent commit will sync it with latest openstack-common
so that it is easier see the new changes.

Change-Id: If88d678b1b9bad3d37117de7f7159d7fea8ab4c8
2012-02-03 19:21:54 +00:00
Jenkins
2e90fa65d1 Merge "blueprint nova-image-cache-management phase1" 2012-02-03 06:10:30 +00:00
Michael Still
53a5f66576 blueprint nova-image-cache-management phase1
Phase 1 of the image-cache-management blueprint. Implement
checksumming and verification of base images, as well as
removal of base images which are not in use. Removal is
enabled with a flag.

Change-Id: Ib04a02075a103c2fef6716fd0ac87c41a3535d37
2012-02-03 09:53:15 +11:00
Johannes Erdfelt
8e29ebf66c Fix disassociation of fixed IPs when using FlatManager
Fixes bug 925664

The model was disassociated from instance, but the code wasn't updated to
use instance_id instead

Change-Id: I532bd1f0f1d89353b6353215e80b74e9a14d989d
2012-02-02 19:25:07 +00:00
Jenkins
47ba441f2e Merge "Optionally disable file locking." 2012-02-02 17:31:16 +00:00
Jenkins
0b065399ae Merge "Avoid weird test error when mox is missing" 2012-02-02 16:47:02 +00:00
Mark Washenberger
43ffe75c59 Optionally disable file locking.
File locks in nova have a bad habit of lingering if the process that
created them is killed, and there isn't a good automated way to fix this
behavior. This option allows a deployer to avoid the problem if they
know they are only running a single nova process on a machine.

Change-Id: I1ae20cc54a4614b200093ffd581d3ab21d7c241b
2012-02-02 11:41:12 -05:00
Thierry Carrez
1ca6273edf Avoid weird test error when mox is missing
Fail early if you can't import mox, rather than return
a cryptic and undecipherable error. Fixes bug 810424.

Change-Id: Ie56d3e7447bbba841fdc882cb1f8f70e234812ef
2012-02-02 17:29:05 +01:00
Jenkins
046e74c3d4 Merge "Add support for pluggable l3 backends" 2012-02-02 00:50:14 +00:00
Brad Hall
ea18346777 Add support for pluggable l3 backends
This will allow us to support backends other than linux_net (i.e.
quantum L3 when it is available) for defining L3 connectivity.

Change-Id: I0b2ece2278bd68166741107a88cedd106d1ab651
2012-02-01 15:44:41 -08:00
Jenkins
5b7e08b3bb Merge "Fix VPN ping packet length." 2012-02-01 21:49:49 +00:00
Jenkins
aa6f6fa559 Merge "lockfile.FileLock already appends .lock" 2012-02-01 20:42:33 +00:00
Jenkins
c819ec6e8c Merge "Ties quantum, melange, and nova network model" 2012-02-01 20:16:03 +00:00
Johannes Erdfelt
bf5b0f5eef lockfile.FileLock already appends .lock
Otherwise you end up with files like nova-iptables.lock.lock

Change-Id: Ia7dd82c3721f89d438c1266e7ec3535a0d89334e
2012-02-01 20:08:29 +00:00
Trey Morris
3059d31879 Ties quantum, melange, and nova network model
get_instance_nw_info() now returns network model, and keeps the network
info cache up to date.
virt shim and translation in place for virts to get at the old stuff

Change-Id: I070ea7d8564af6c644059d1c209542d250d19ddb
2012-02-01 13:29:14 -06:00
Russell Bryant
ec5fb6b690 Fix VPN ping packet length.
Fix bug 906346.

This patch addresses the typo pointed out in bug 906346.  The ping being
sent was 15 bytes long when it should have been 14.  Removing a pad byte
from the format string resolves this issue.  I verified that the format
described in the code comments (and now the code) was correct using an
OpenVPN connection setup packet capture.

Change-Id: Idbc5e48ede4a8d2836dd1b102a9a0e172540776c
2012-01-31 20:30:50 -05:00
Russell Bryant
40ccefa987 Remove utils.runthis().
Fixes bug 884825.  The bug was pointing out some unused variables
noticed by pylint.

utils.runthis() was only used in one place and doesn't really provide
much value over utils.execute(), so just remove it.

Change-Id: I3dcc34bd840a128418b58a8a66acb62adf3fc9cc
2012-01-31 14:52:55 -05:00
Jenkins
b251a8896c Merge "Remove session arguments from db.api" 2012-01-30 16:38:35 +00:00
Jenkins
81dad08032 Merge "Refactor away the flags.DEFINE_* helpers" 2012-01-30 16:27:15 +00:00
Mark McLoughlin
80823ed1bd 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
Jenkins
49013e411d Merge "Remove session arg from sm_backend_conf_update" 2012-01-27 23:31:27 +00:00
Brian Waldon
43aa98521d Remove session arg from sm_backend_conf_update
Fixes bug 915108

Change-Id: Ic22bf5aa3d68ea59692ebe05d1b0b79757c70b52
2012-01-27 09:39:31 -08:00
Mark Washenberger
8e15bdc9a6 Remove session arguments from db.api
Possibly through copy-paste errors, some sqlalchemy session keyword args
made it into the db api. Some aren't even passed in to the IMPL's
equivalent function, and a db.api client has no sensible way of creating
such a session to pass in. Therefore this patch removes them.

Change-Id: I75237b542bdf4f75c1a07ae38bf485e0ff080339
2012-01-27 00:22:04 -05:00
Jenkins
44ddcb8d65 Merge changes If0c92dca,I75d8b616
* changes:
  blueprint host-aggregates: OSAPI extensions
  blueprint host-aggregates: OSAPI/virt integration, via nova.compute.api
2012-01-26 19:02:25 +00:00
Jenkins
47183ee101 Merge "Fixes bug 921265 - i'nova-manage flavor create|list'" 2012-01-25 22:10:29 +00:00
Armando Migliaccio
f8bedd7749 blueprint host-aggregates: OSAPI extensions
This commit introduces the OSAPI admin extensions for host aggregates.
This is part of a series of commits that have started with change:

https://review.openstack.org/#change,3035

Change-Id: If0c92dca7d6f5d794f84bdb2adc172c55dec6e74
2012-01-25 18:33:18 +00:00
Armando Migliaccio
47ba28ecb7 blueprint host-aggregates: OSAPI/virt integration, via nova.compute.api
This commit introduces the first cut of integration between the OSAPI
Admin extensions for host aggregates and the virt layer.

This is part of a series of commits that have started with change:

https://review.openstack.org/#change,3035

Change-Id: I75d8b616e3b8f8cef75d40d937e0dce9f29b16db
2012-01-25 17:09:54 +00:00
Dean Troyer
ccb3c58514 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
Jenkins
53a13df03d Merge "Blueprint xenapi-provider-firewall and Bug #915403." 2012-01-25 15:56:29 +00:00
Deepak Garg
60a876bf16 Blueprint xenapi-provider-firewall and Bug #915403.
1. Provides dom0 IPtables driver to implement the Provider firewall rules.
  2. Existing libvirt code has been refactored to reduce the amount of duplicated code to a minimum
  3. The three provider apis in ec2/admin.py file are now fixed the following way:
    a.    remove_external_address_block returned 'OK' on removing blocks which didn't exist. This is now fixed.
    b.    block_external_addresses raised exception earlier on duplicate network blocks. Now the exception is logged and failed status message is returned.
    c.  all the three provider apis now logs for invalid and improper inputs and return uniform (a dictionary ) and proper status messages for all cases.
  4. appropriate unit tests added to cover the same

Change-Id: I27d83186f850423a6268947aed0c9a349d8f8d65
2012-01-24 22:31:35 -08:00
Jenkins
a7eac4c258 Merge "Create nova cert worker for x509 support" 2012-01-25 00:00:35 +00:00
Vishvananda Ishaya
cd3093ef60 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
Jenkins
fcd9ee1ea0 Merge "usage: Fix time filtering" 2012-01-24 22:48:00 +00:00
Jenkins
c7b6b99113 Merge "Change the logic for deleting a record dns_domains." 2012-01-24 22:13:21 +00:00
Jenkins
0a97a526a1 Merge "Add an API extension for creating+deleting flavors" 2012-01-24 20:52:57 +00:00
Jenkins
7019aa9ac6 Merge "Abstract out _exact_match_filter()" 2012-01-24 18:51:48 +00:00
Cole Robinson
c710b60150 usage: Fix time filtering
Querying for resource usage within a given time range seems to have a
logic flaw: it will only report instances that have run the entire
length of the specified range.

AIUI What we really want is any instance that spent any time consuming
resources at any point in the specified range. Fix the logic to
implement this.

v2:
    Update function comments as well

Change-Id: I4fa567982457e5f447ec33cf3d96457f50d71d86
2012-01-24 13:30:23 -05:00
Cole Robinson
d8363ae3e1 Add an API extension for creating+deleting flavors
This extension is a step towards deprecating openstackx for horizon.
Most of the extension code is based on the equivalent in openstackx.

v2:
    s/lifecycle/manage/ for all bits
    Address Pádraig style issues
    Drop purge API option
    Adjust now inaccurate comment in DB api
    Make extension admin_only
    Extend existing /flavors namespace rather than os-flavor-lifecycle
    Only allow API access from admin user

v3:
    Some pep8 fixes

v4:
    Adjust to root_gb, ephemeral_gb changes
    Drop admin_only (it's on the way out AIUI)

Change-Id: I3fdfccdd8e7337e1759f5875c3b15fa9954371ef
2012-01-24 13:30:23 -05:00
Kevin L. Mitchell
b6f97214b9 Abstract out _exact_match_filter()
In the interests of improving DRY in the sqlalchemy db backend API,
abstract out _exact_match_filter().

Change-Id: Ic381a071005dced6989e9e9696930fd85b6d5d46
2012-01-24 12:01:48 -06:00
Jenkins
2a2d42277e Merge "Adds a bandwidth filter DB call." 2012-01-24 17:51:05 +00:00