Commit Graph

1439 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
Josh Kearney
3563a693c5 Adds a bandwidth filter DB call.
Change-Id: I7721bae1af900c215552f547e125c2b1e60b271e
2012-01-24 11:09:51 -06:00
Johannes Erdfelt
dd65c7d7b8 KVM and XEN Disk Management Parity
Implements blueprint disk-configuration-parity

This change splits local_gb into root_gb and ephemeral_gb. libvirt
interpreted local_gb as what ephemeral_gb is now, whereas XenAPI
interpreted local_gb as what root_gb is now.

Change-Id: I496600991bac1e990326d4ded1607fee08209d68
2012-01-24 16:54:23 +00:00
Sandy Walsh
72d710217e ComputeNode Capacity support
The table represents the current state of compute nodes and will be
used by the scheduler when selecting a host.

Re: https://blueprints.launchpad.net/nova/+spec/scaling-zones

This is just the db & notification portion of the branch. The scheduler
portion is being deferring until comstuds branch gets merged since it
conflicts heavily.

NOTE: Compute notifications are now two-part.
There is a compute.instance.XXX.start event and a compute.instance.XXX.end
message instead of the previous compute.instance.XXX event (which is
the same as the .end message)

Change-Id: Ia8e68680cb0924c59df84f2eec858febf4926d65
2012-01-23 07:45:33 -08:00
Andrew Bogott
e763ffe6ea Change the logic for deleting a record dns_domains.
Since keys are just the domain name, we need to be able
to reuse them.  That means we have to do a real record
deletion to free up namespace rather than just mark the
records as deleted.

For blueprint public-and-private-dns.

Change-Id: If47e961cf2cb977d297b506bd397f1a438499f18
2012-01-21 01:07:35 +00:00
Dean Troyer
0b6a75a7e4 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
Chris Behrens
12068866f7 scheduler host_manager needs service for filters
distributed scheduler isn't checking service_is_up or
services['disabled'] due to filters not having access to service.

Fixed both.  Since ec2 API also uses service_down_time, I moved
service_is_up() into utils and made ec2 use it.

Change-Id: I0321844a47031b2de4d8738e032a4634edd1e945
2012-01-19 22:02:25 -08:00
Andrew Bogott
92e66df6e7 Add dns domain manipulation to nova.
Adding this functionality required the existing DNS api
to be rearranged considerably.

Nova needs to track some information about domains that is
outside the scope of the DNS driver, specifically the availability
zone of a private domain and the project of a public domain.
In order to track those attributes, this patch adds a new table
to the Nova database, dns_domains.

This patch perpetuates some naming ambiguities (e.g. zone vs. domain).
A future renaming patch will sort all this out.

For blueprint public-and-private-dns.

Change-Id: I80865207d34ab7c6e2afc5638863a299b3913f8e
2012-01-18 12:39:50 -06:00
Armando Migliaccio
17135ed2c6 blueprint host-aggregates
This is the first of a series of commits that add the host-aggregates capability,
as described on the blueprint page.

This commit, more precisely, introduces changes to the Nova model: model classes
related to aggregates have been added, as well as DB API methods to interact with
the model; a sqlalchemy migration script plus a bunch of tests are also part of
this changeset.

Commits that will follow are going to add:

- Extensions to OSAPI Admin, and related python_novaclient mappings
- Implementation of the XenAPI virt layer
- Integration of OSAPI and virt layer, via the compute_api
- smoketests
- openstack-manuals documentation

These commits will be pushed for review not necessarily in this exact order.

Change-Id: Iceb27609dc53bf4305c02d7cbc436fba4c4a7256
2012-01-17 18:47:56 +00:00
Alvaro Lopez Garcia
682b61c4ec Fixes bug 917128
Change-Id: I01c384666ae2366638fe77ffbe2f85e9e2692303
2012-01-17 10:15:32 +01:00
Jason Kölker
0c90acfb15 Implement BP untie-nova-network-models
Fixes LP853979
Remove the FK references for network data.
Remove unused db functions that used the FK's
Update db functions to not joinload
Update notification to optionally take network_info if compute has it
Update EC2 Api to use the network cache, falling back to rpc.call
Remove test_instance_get_project_vpn_joins which tests calls not used

Change-Id: I1a01ccc5ebcf7efeafe014af62be893325bb0825
2012-01-16 10:52:56 -06:00
Alex Meade
294e751a59 Call to instance_info_cache_delete to use uuid
Fixes bug 903497
Also updated incorrect calls to instance_destroy that were using uuids.

Change-Id: I25eead020ceb7ebf7234c268543ad77d8ecf1185
2012-01-11 19:44:58 +00:00
Kevin L. Mitchell
8b98df8dca Add @utils.deprecated().
This will allow us to mark deprecated classes and functions/methods as
such.  A warning is issued each time a deprecated function/method is
called, or when a deprecated class is instantiated, or when any class
or static method on a deprecated class is called.

Change-Id: I4b5858492bc14768ac2e12c542bc343962761e34
2012-01-10 11:22:33 -06:00
Vishvananda Ishaya
80f6ddf3d4 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
Vishvananda Ishaya
d383ef607a Refactors utils.load_cached_file
* adds a boolean return representing whether file was reloaded
 * ensures file is actually closed by using a context manager

Change-Id: I4d998c34caa6dde65aaf780c188778477b7f6753
2012-01-09 11:40:04 -08:00
Jenkins
12dade1a29 Merge "preload cache table and keep it up to date" 2012-01-06 22:07:36 +00:00
Vishvananda Ishaya
94101b6cfc Workaround bug 852095 without importing mox
* Fixes bug 912828

Change-Id: Iade4b0aca1d1f28ce46ed25d0b97c08d152554bd
2012-01-06 11:05:12 -08:00