16173 Commits

Author SHA1 Message Date
Vishvananda Ishaya
8d43c3fba1 Makes scheduler hints and disk config xml correct
The scheduler hints and disk config extensions were not using
proper prefixes when deserializing xml. This patch modifes
them to deserialize properly. It leaves the old deserialization
in place as well so anyone using the broken implementation
will continue to work.

It also updates the api samples to use the new format. Note that
the proper fix required changing the alias for the scheduler hints
extension, since the alias is used for xml, so the samples had
to be moved.

Finally it fixes an issue with deserialization, allowing it to
support multiple hints with the same name.

Part of bug 1050997

Change-Id: I9969582d65d44de25388f07b6d2013fb7d093fb2
2012-09-18 12:46:52 -07:00
Vishvananda Ishaya
71c9677d80 Add deserialization for multiple create and az
We were not deserializing xml values causing the multiple create
extension and the availability zone extension to fail with xml.

This adds deserialization for these attributes and adds tests

Part of bug 1050997

Change-Id: Ic40ce58b0854717dd99dba8ed39c861e31e6bba4
2012-09-18 11:56:54 -07:00
Jenkins
afefc88389 Merge "Fix volume id conversion in nova-manage volume" 2012-09-18 16:31:53 +00:00
Jenkins
b733ecb37e Merge "Add console output extension to API samples test." 2012-09-18 16:29:26 +00:00
Jenkins
7281eb0594 Merge "Fixes snat rules in complex networking configs" 2012-09-18 16:09:50 +00:00
Jenkins
f615e9c22c Merge "Fix volume deletion when device mapper is used" 2012-09-18 15:50:00 +00:00
Matthew Treinish
32c8c53f47 Add console output extension to API samples test.
Change-Id: I0ac1f893b06882acaa7c61dade61eb991a5d0d04
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
2012-09-18 10:03:27 -04:00
Jenkins
5b8d9ada4b Merge "Make DeregisterImage respect AWS EC2 specification" 2012-09-18 12:52:52 +00:00
Jenkins
9f5f7dae75 Merge "Fixes error handling during schedule_run_instance" 2012-09-18 07:55:02 +00:00
John Griffith
088472b86f Fix volume id conversion in nova-manage volume
The nova-manage volume commands weren't updated when the switch
  from int volume-id's to uuid's was made.  This updates the
  param2id method to call the appropriate conversion, and doesn't
  attempt to cast the value to an int.

  There is an additional issue with the nova-manage commands with the
  introduction of Cinder.  The calls in nova-manage are direct to the
  nova database which when using Cinder is not valid.  Add an error message
  when trying to use delete or re-attach commands as they don't work.

  This change deprecates the nova-manage delete function as it's now
  implemented as an admin extension (nova commit id: If795599d and
  cinder commit id: I29f4b892).

  The reattach command is only valid for nova-volumes, a similar extension
  will need to be added to cover cinder at which time the nova-manage volume
  reattach can be deprecated as well.

  Partial fix for bug #1051603

Change-Id: I666d4e627dee4a2025f7135560ee36c40f4bf17a
2012-09-17 21:06:14 -06:00
Jenkins
5fc0dbb912 Merge "Allows waiting timers in libvirt to raise NotFound" 2012-09-18 01:27:13 +00:00
Jenkins
d298294f79 Merge "Add admin actions extension" 2012-09-18 01:26:30 +00:00
Vishvananda Ishaya
91734bad91 Fixes error handling during schedule_run_instance
If there are not enough hosts available during a multi-instance launch,
every failing instance should be updated to error state, instead of
just the first instance. Currently only the first instance is set
to Error and the rest stay in building.

This patch makes a number of fixes to error handling during scheduling.

 * Moves instance faults into compute utils so they can be created
   from the scheduler.
 * Moves error handling into the driver so that each instance can be
   updated separately.
 * Sets an instance fault for failed scheduling
 * Sets task state back to none if there is a scheduling failure
 * Modifies chance scheduler to stop returning a list of instances
   as it is not used.
 * Modifies tests to check for these states.

In addition to the included tests, the code was manually verified on
a devstack install

Fixes bug 1051066
Fixes bug 1019017

Change-Id: I49267ce4a21e2f7cc7a996fb2ed5d625f6794730
2012-09-17 17:46:45 -07:00
Jenkins
2628697679 Merge "Include volume_metadata with object on vol create" 2012-09-18 00:35:51 +00:00
Jenkins
baf5e03f1c Merge "Add man pages" 2012-09-18 00:18:47 +00:00
Jenkins
1a2e412468 Merge "Reset the task state after backup done." 2012-09-17 22:43:01 +00:00
Jenkins
6f129a4c79 Merge "Includes sec group quota details in limits API response" 2012-09-17 22:42:40 +00:00
Jenkins
036953b177 Merge "Add api samples to Scheduler hints extension" 2012-09-17 21:53:53 +00:00
Jenkins
0f1b972b06 Merge "Include Schedule Hints deserialization to XML API" 2012-09-17 21:53:27 +00:00
John Griffith
9733b4eb9f Include volume_metadata with object on vol create
Fix for Bug 1029762

The symptom of this bug is that the response data of an
OSAPI create call always shows and empty dict for volume_metadata
regardless of what was passed in to created and actually used.

Upon the db create_volume call a reference to the volume
object is all that was being returned.  Since metadata is
specified and set, it should also be returned with the
create reference object.

This will result in the the osapi create call returning
a body with correct metdata info rather than always showing
and empty dict as it was previously.

Change-Id: I469e06941f446526bae39168f3b1ebfea851e0ef
2012-09-17 15:17:36 -06:00
eddie-sheffield
73e8d5a7b6 Reset the task state after backup done.
The compute manager needs to reset the task state after a backup
is complete. However it was only correctly reseting after a
snapshot due to the current expected state being hardcoded.
Now looks for the correct expected state depending on whether a
backup or snapshot was being executed.

Fixes bug 1051069

Change-Id: Ie91f7745b98232370be6c99d318a8033a93cc50c
2012-09-17 16:56:04 -04:00
Vishvananda Ishaya
e6e5123cce Allows waiting timers in libvirt to raise NotFound
There are cases where an operation will fail when communicating with
libvirt. We were eating the exception even though the operation
failed, which has the potential to put the instance into an
unrecoverable state.

This patch allows NotFound exceptions to propogate up so that they
are caught by the state handling code and the task state can be
set to error.

Fixes bug 1002814

Change-Id: Iddc319b24aee0b7132155f50b9d3b0eee9bb3fa8
2012-09-17 13:48:47 -07:00
Mark McLoughlin
76ca8c184b Improve entity validation in volumes APIs
Fixes bug #1048565

Use the new Controller.is_valid_body() helper to validate the entity
body in various volumes related POST/PUT handlers and return 422
as appropriate.

(Cherry picks commit dcecb586 from Cinder and adds similar fixes for
the volumes bits in the compute API)

Change-Id: I04127972981522c1ed81903893396c4f9665bcd3
2012-09-17 21:44:05 +01:00
Rafi Khardalian
d05637f992 Fix volume deletion when device mapper is used
Call dmsetup remove if there is a /dev/mapper/nova--volumes-
element present.

Resolves bug 979020

Change-Id: Iddaaed411a77dda4bd32f9a97687ff17744119eb
2012-09-17 20:36:09 +00:00
Joe Gordon
c8b15fc78c Add man pages
Add partially written manpages for:
* nova-all
* nova-api-ec2
* nova-api-metadata
* nova-api-os-compute
* nova-api-os-volume
* nova-api
* nova-cert
* nova-compute
* nova-console
* nova-consoleauth
* nova-dhcpbridge
* nova-network
* nova-novncproxy
* nova-objectstore
* nova-rootwrap
* nova-rpc-zmq-receiver
* nova-scheduler
* nova-volume-usage-audit
* nova-volume
* nova-xvpvncproxy

Change-Id: I3734831ce2f6b5d765e98b3f50fe8c1ad7965685
2012-09-17 12:00:08 -07:00
Jenkins
725c99b2a9 Merge "Deserialize user_data in xml servers request" 2012-09-17 18:37:24 +00:00
Jenkins
2500eb2049 Merge "Clean up handling of project_only in network_get" 2012-09-17 18:31:41 +00:00
Jenkins
5206850e1c Merge "Add README for doc folder" 2012-09-17 17:37:32 +00:00
Jenkins
1270149696 Merge "Add api_samples tests for servers actions" 2012-09-17 15:21:18 +00:00
Jenkins
88ba5f2887 Merge "Fix XML deserialization of rebuild parameters" 2012-09-17 15:20:54 +00:00
Jenkins
b082d668aa Merge "Make compute/manager.py use self.host instead of FLAGS.host" 2012-09-17 15:20:23 +00:00
MotoKen
632770e131 Make DeregisterImage respect AWS EC2 specification
The return value of current deregister_image implementation is the AMI id.
Howerver, according to Amazon EC2 API documentation, the return value of
DeregisterImageResponse should be boolean.

See more detailed documentation in:
http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DeregisterImage.html

The example response:
<DeregisterImageResponse xmlns="http://ec2.amazonaws.com/doc/2012-08-15/">
  <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
  <return>true</return>
</DeregisterImageResponse>

This patch changes the response and test case for deregister_image.

Fixes bug 1051752.

Change-Id: Ifd31b88ec4f575f50244079cdeed4c9ff57206f8
2012-09-17 19:18:26 +08:00
Vishvananda Ishaya
9d0a6d88d5 Deserialize user_data in xml servers request
Also adds better validation for b64 encoded data since python
will happily ignore illegal bytes in the base64 encoded data.

Fixes bug 1050797

Change-Id: I4f380d029ec2d51f130a6dbd581410873e414216
2012-09-16 09:51:09 -07:00
Mauro S. M. Rodrigues
940e1cfd7d Add api samples to Scheduler hints extension
Change-Id: Ic324d796dac0cfc7b36c47a181b55e09cb1503e2
2012-09-15 20:32:27 -04:00
Mauro S. M. Rodrigues
81e76480af Include Schedule Hints deserialization to XML API
So far the xml format to schedule hints were not defined.
Once defined (in ML), this patch add support to its deserialization.

This patch also includes a xml deserialization method to get the Elements
between the childs of a node.

Partially fixes bug 1050997

Change-Id: I2a34dbbd6200755818d7eaa7330a96d61a043614
2012-09-15 19:13:27 -04:00
Jenkins
9536b3fa98 Merge "workaround lack of quantum/nova floatingip integration" 2012-09-15 14:06:18 +00:00
Jenkins
99479d7c81 Merge "Corrects use of instance_uuid for fixed ip" 2012-09-15 13:55:03 +00:00
Jenkins
ec7ce6aaf7 Merge "All security groups not returned to admins by default." 2012-09-15 00:34:00 +00:00
OpenStack Jenkins
dbee359bf2 Merge "Imported Translations from Transifex" 2012-09-15 00:06:07 +00:00
Jenkins
9e90e59590 Merge "Add security groups extension to API samples test." 2012-09-14 23:14:16 +00:00
Jenkins
5e94da199c Merge "Remove useless _get_key_name() in servers API" 2012-09-14 22:55:44 +00:00
Jenkins
cdcd8857f0 Merge "Add entity body validation helper" 2012-09-14 22:55:25 +00:00
Clay Gerrard
4ebec87730 Add admin actions extension
The optional os-admin-actions extension adds new wsgi_actions to the
volumes/action resource and a new snapshots/action endpoint.

With this extension both controllers will support an os-reset_status
action to force a database update of a volume or snapshot that is stuck
in a failed/incorrect status. The os-reset_status action works
similarly to the compute api's os-reset_state action for instances.

The os-force_delete action behaves similarly to the "cinder-manage
volume delete" command and allows operators/admins to retry the delete
operation after it has gone into an error_deleting status with an admin
api call.

The os-admin-actions extension is enabled by default, but limited to the
admin api by the default policy.json rules. Individual admin actions
can be disabled with policy rules as well.

Example of os-reset_status action on a volume:

curl http://localhost:8776/v1/${PROJECT_ID}/volumes/${VOLUME_ID}/action \
    -H "x-auth-token: ${ADMIN_AUTH_TOKEN}" \
    -H 'content-type: application/json' \
    -d '{"os-reset_status": {"status": "error"}}'

The new admin only api can assist deployers who encounter bugs or
operational issues that result in failed actions.

It can also be used by future storage backends to support async callback
style status updates from long running actions or operations which have
encountered an error will be retried.

Also updates the api.openstack.wsgi.ControllerMetaclass to support
sub-classing wsgi.Controllers that define wsgi_actions.

Partial fix for bug #1039706

Change-Id: If795599d5150dea362279d75a75276f3166d0149
2012-09-14 16:40:03 -05:00
Jenkins
d41b93267f Merge "Allow older versions of libvirt to delete vms" 2012-09-14 20:49:49 +00:00
Vishvananda Ishaya
c6ddff821f Allow older versions of libvirt to delete vms
Libvirt < 0.9.4 doesn't support undefineFlags, so the vms can't be
deleted. This patch adds a workaround to fallback to the old style
of undefine if undefineFlags throws an Attribute error. It also
attempts to remove any managed save images that exist.

Fixes bug 1051010

Change-Id: I155fe2ab3be347b1515c5aab4a9233921bd722ca
2012-09-14 12:26:03 -07:00
Matthew Treinish
0e0d46353e Add security groups extension to API samples test.
Change-Id: Ie7635cacf96e0bafbd412ff40d7912aa0da4677d
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
2012-09-14 15:15:10 -04:00
Russell Bryant
0c47b74b84 Sync a change to rpc from openstack-common.
This commit pulls in the following change from openstack-common:

    ee44222 Change the qpid_heartbeat default to 60 seconds.

Fix bug 1050661.

Change-Id: I42acdca42f27fbbe9a52441f8cf7ea8261fd8d24
2012-09-14 13:59:25 -04:00
Dan Smith
52c850bb1d Add api_samples tests for servers actions
Change-Id: I67446ccd53c83b5fcfc3a1857a10e160263834dd
2012-09-14 10:32:27 -07:00
Dan Smith
d68d2fba65 Fix XML deserialization of rebuild parameters
This picks up the following attributes which are currently ignored
when poking this via XML:
 - accessIPv4
 - accessIPv6
 - adminPass

Change-Id: I947aa2f942022d839919ae7516759955e5b06668
2012-09-14 09:02:25 -07:00
Jenkins
c1af117628 Merge "Add a resume delete on volume manager startup" 2012-09-14 15:45:40 +00:00