Commit Graph

38835 Commits

Author SHA1 Message Date
Jianghua Wang 2aa81e9ef6 XenAPI: introduce unit test for XenAPI plugins
This is the first patch set to introduce unit test for XenAPI
plugins. It contains the common part depended by other plugin
tests. In order to make this first patch set to be as simple
as possible, it only covers the test framework and the unit
test for a simple plugin.

Change-Id: Iece439661cc4337e826d0eb15b438d2716214fb5
2016-03-02 06:54:06 +00:00
Jenkins d51c5670d8 Merge "reset task_state after select_destinations failed." 2016-02-18 17:56:33 +00:00
Jenkins 4fade907ea Merge "Fix create snapshot failure on VMs with SRIOV" 2016-02-18 15:11:18 +00:00
Jenkins ee12a3a82e Merge "libvirt: make live_migration_uri flag dependent on virt_type" 2016-02-18 15:09:21 +00:00
Jenkins 1ae702a622 Merge "Update instance host in post live migration even when exception occurs" 2016-02-18 15:01:51 +00:00
Jenkins 771fd3df92 Merge "nova-manage: Add hooks for running data-migration scripts" 2016-02-18 13:58:36 +00:00
gh159m 603e7db9a8 Fixed arguement order in remove_volume_connection
RPC API and ComputeManager both contain a function named
remove_volume_connection with the same arguments, but ordered
differently.  This causes problems when called by
_rollback_live_migration.

This fix is more for future consistency, as this was affecting the
_ComputeV4Proxy class, which is present in stable/kilo but
no longer exists.

Change-Id: Iacadd5f015888c4181b8a332625ec746f991e239
Closes-Bug: #1538619
2016-02-16 14:42:25 -06:00
Nikola Dipanov 7d5069ce20 nova-manage: Add hooks for running data-migration scripts
As data migrations can be of arbitrary complexity, it is very difficult
to nail down a framework other than just a method call that does all the
work. We want to be able to control how much work is done during each
run, but that's about it.

After writing a method that does the migrations, optionally limited by
the max_count argument that can be passed in, developers who introduced
the migration  will just need to declare it as part of the
online_migrations tuple on the DbCommands class, and the operators can
simply run a single online_data_migration command to migrate all the
declared migrations.

See tests for some simple examples.

Change-Id: I23810de8fc0d3875daf19af08bc9b57461f177ee
2016-02-16 13:32:28 +00:00
Pawel Koniszewski 89b1fecce1 Update instance host in post live migration even when exception occurs
Currently when, e.g., port binding fails on destination host nova
loses track of running VM. Operator needs to change record in DB
manually in order to recover VM in nova and then perform operations
on destination host to repair such VM. Because VM is on destination
host already it should be updated regardless of post live migration
at destination result.

Change-Id: Ibb5158f453abd9717e6d2ab501295351ca9d0dcf
Closes-Bug: #1379581
2016-02-16 12:55:28 +00:00
bhagyashris 11019fab7a Remove duplicate key from dictionary
There is a duplicate dictionary key entry in test_vmops.py.
Removed duplicate key 'display_name' from dictionary.

TrivialFix

Change-Id: I4e779bceb26077b95bd3ae4ab19e60152c126e34
2016-02-16 01:48:35 -08:00
Jenkins dbdf27021c Merge "objects: Rename PciDevice _migrate_parent_addr method" 2016-02-16 08:55:33 +00:00
ShaoHe Feng 30d5d805c1 reset task_state after select_destinations failed.
During live migration, there maybe exception when let scheduler
select destination, and live migration will abort. But the task
state of the instance still keep migrating, then we can not take
any action on this instance.

We need to recover the state of the task as None.
We should also recover the vm_state.

Change-Id: If1cae8f4c9037f7821554a94d4440f66d9538794
Closes-bug: #1536916
2016-02-16 07:01:46 +00:00
Jenkins b57fbc725f Merge "Tolerate installation of pycryptodome" 2016-02-15 23:34:35 +00:00
Jenkins e5fef6b3c6 Merge "relocate os_compute_api:servers:discoverable" 2016-02-15 23:31:47 +00:00
Jenkins 5aee67a80a Merge "Move Disk allocation ratio to ResourceTracker" 2016-02-15 21:56:10 +00:00
David Edery f93d808bc3 Fix create snapshot failure on VMs with SRIOV
One use-case of guest VM network protection using SRIOV ports is having
two direct ports connected to a VM, each one is related to a network that
is connected to a different physical NIC on the host (e.g. phyNet1 on
eth0 and phyNet2 on eth1). In this use-case, due to some physical NICs
limitations it's advised to configure both ports with the same MAC
address (or else outgoing or incoming traffic will not reach its
destination in case of fail-over).

Snapshot creation on such VMs fails since libvirt's detach-interface
doesn't know which interface of the two to detach and fails. This is why
I've changed the call inside _detach_sriov_ports from (the equivalent
of) detach-interface to _detach_pci_devices with the source-device
pci address of the SRIOV VF (always present in the context of SRIOV
of course).

This fix was tested on a real environment containing the above type of
VMs. test_driver.test_detach_sriov_ports was slightly modified so
that the VIF from which data is sent to _detach_pci_devices will
contain the correct SRIOV values (pci_slot, vlan and hw_veb VIF type)

Change-Id: If3edc1965c01a077eb61984a442e0d778d870d75
Closes-Bug: #1529785
2016-02-15 23:37:53 +02:00
Jenkins 2e28de7c5b Merge "Allocate UUID for compute node" 2016-02-15 20:46:12 +00:00
Jenkins 9d5a6cef5b Merge "Reorder name normalization for DNS" 2016-02-15 19:30:48 +00:00
Jenkins fa9c327b17 Merge "rpc.init() is being called twice per test" 2016-02-15 18:52:50 +00:00
Matthew Treinish 7e79d83641 Reorder name normalization for DNS
Having the truncation step as the last one meant we could truncate to
a trailing hyphen. This could potential cause a failure for an invalid
name. This commit reorders the normalization to put the truncation as
the first step which should avoid that problem.

Change-Id: I2219f6c73d882efc787127f02fda937f3e3b44eb
Closes-Bug: #1545153
2016-02-15 09:21:09 -08:00
Dan Smith 4c05740b85 Allocate UUID for compute node
This patch causes us to allocate a UUID for ComputeNode on create or
when loaded from the database. Since we don't currently have them,
query needs to handle this case to migrate us to the point where we
can add a uniqueness and non-null-ness constraint on that column in
the database. We take a small hit every time we query a compute node
that doesn't have a uuid, by generating it and saving it back to the
database immediately, but this only happens once.

Related to blueprint compute-node-inventory

Change-Id: I9e8bd5f2ed064923ed04feb864b42e4b2948812d
2016-02-15 15:44:02 +00:00
Jenkins 30db005156 Merge "Use instance hostname for Neutron DNS unit tests" 2016-02-15 15:08:31 +00:00
Diana Clarke a82ed4fd35 rpc.init() is being called twice per test
setUp calls rpc.init() twice for each test, once in each of:

    self.useFixture(conf_fixture.ConfFixture(CONF))
    self.useFixture(nova_fixtures.RPCFixture('nova.test'))

Stop calling rpc.init() in ConfFixture, and defer to RPCFixture for
initialization.

The calls to rpc.init() in ConfFixture were taking 0.01 seconds each.

    0.01 seconds * 14784 tests = 2.5 minutes

Change-Id: I710399b9b9286884f3ed71522d2697680951c20e
2016-02-15 09:07:23 -05:00
Jenkins 221cf22ce8 Merge "Fix reported ppc64le bug on video selection" 2016-02-15 13:13:10 +00:00
Jenkins cbbf2d1fa0 Merge "Replace except Exception with specific exception" 2016-02-15 11:56:37 +00:00
Miguel Lavalle 997d8f516c Use instance hostname for Neutron DNS unit tests
Adds  units tests for the changes made to the Neutron API to use the instance
hostname for Neutron. Also, a release note is added and some comments are
fixed.

Change-Id: Ie74cb5ee71ea464d0863b14577c7dc2c9b534cf6
Implements: blueprint neutron-hostname-dns
2016-02-15 11:49:09 +00:00
Jenkins 200f112a25 Merge "Remove unused CONF imports" 2016-02-15 11:45:44 +00:00
Jenkins af8ae42efa Merge "Fix 500 error for showing deleted flavor details" 2016-02-15 11:41:13 +00:00
Nikola Dipanov 9d141967e5 objects: Rename PciDevice _migrate_parent_addr method
We want to make this part of the API the framework for building
nova-manage scripts hooks into, so we want to make sure the name
reflects this. We also add a no-op method to the NovaObjects base class
to emphasize this.

In the future we may want to add more knobs to this interface but that
should be easily doable since that method is not remotable.

Change-Id: Ia54101a017b735fb972d58b50c9cae37494872e5
2016-02-15 10:47:24 +00:00
Alvaro Lopez Garcia 3159c8fd5b libvirt: make live_migration_uri flag dependent on virt_type
The default value for the "live_migration_uri" flag should be
dependent on the "virt_type" flag, as the "connection_uri" flag is. This
way, an operator can set the "virt_type" flag without the need to check
for each individual uri.

DocImpact: Changed the default value of the "live_migration_uri" flag,
that now is dependent on the "virt_type".
Closes-Bug: #1298242
Change-Id: Id54f7bdfa14a19da41da554b13ba9496ee525c71
2016-02-15 09:50:01 +01:00
Michael Still 50a9550999 Remove unused CONF imports
While reviewing config centralization patches I realized that
we have a fair few files where we import cfg or setup CONF, but
never actually use config variables.

This patch cleans those up, but I am sure we'll add more as we
move more flags around.

Change-Id: I5851bbae2fa198a4e9be149a5836bea813848d89
2016-02-15 16:40:53 +11:00
Jenkins dd03245bf1 Merge "remove the redundant policy check for SecurityGroupsOutputController" 2016-02-14 06:15:28 +00:00
Davanum Srinivas 1fd0f4f69b Tolerate installation of pycryptodome
Newer versions of pysaml2 uses pycryptodome, so if by
accident if this library gets installed, Nova breaks.

paramiko folks are working on this:
https://github.com/paramiko/paramiko/issues/637

In the meanwhile, we should tolerate if either pycrypto
or pycryptodome is installed.

Closes-Bug: #1545370
Change-Id: If88beeb3983705621fe736995939ac20b2daf1f3
2016-02-13 21:29:28 -05:00
Jenkins 9d615b7eec Merge "Updated from global requirements" 2016-02-12 22:12:22 +00:00
Jenkins 8bdd2b2c9b Merge "Improve unit tests for instance multiple create" 2016-02-12 20:35:14 +00:00
Sylvain Bauza 0ecc870199 Move Disk allocation ratio to ResourceTracker
We already moved the CPU and RAM ratios to the compute nodes in Liberty
but we forgot to add the disk one. Adding it now.

That change specifically implies that nova.conf is consistent across the whole
cloud since what was formerly defined on the scheduler side will have its
definition by the compute nodes.

Co-Authored-By: Sylvain Bauza <sbauza@redhat.com>
UpgradeImpact

Change-Id: Id4b44dc4c3391563154a30406a5f1e7a2dc015b3
Partially-Implements: blueprint disk-allocation-ratio-to-rt
2016-02-12 21:33:33 +01:00
Jenkins 7616c88ad3 Merge "Change populate_security_groups to return a SecurityGroupList" 2016-02-12 20:30:25 +00:00
OpenStack Proposal Bot 84fdf2dca1 Updated from global requirements
Change-Id: I24f3dc7739aa1dd8d1a06a5fd5c4a134a8657eb1
2016-02-12 20:04:58 +00:00
Jenkins 12d224e7df Merge "Use instance hostname for Neutron DNS" 2016-02-12 14:23:26 +00:00
Jenkins 8a74b3c517 Merge "config options: Centralise 'virt.driver' options" 2016-02-12 08:14:23 +00:00
bhagyashris 4184f98501 Fix 500 error for showing deleted flavor details
Displaying deleted flavor details throws 500 internal server error.
Added 404 HttpNotFound status code in "@extension.expected_errors".

APIImpact: Return 404 status code for list extra specs
for a deleted flavor.

Closes-Bug: #1538896

Change-Id: Iba33296c28c3c3d6ba60052fe434107ac9c00c61
2016-02-12 00:01:56 -08:00
Jenkins d98ec2e4b7 Merge "Properly inject network_data.json in configdrive" 2016-02-12 05:59:32 +00:00
Jenkins c3daa0e8af Merge "Add methods for RequestContext to switch db connection" 2016-02-12 01:22:06 +00:00
Jenkins b7deeddfac Merge "resource_providers, allocations and inventories models" 2016-02-11 19:30:30 +00:00
Sean Dague 87069e7bf7 Fix reported ppc64le bug on video selection
ppc64le apparently is the same as other ppc plaforms in it's video
selection. This one line fix was put into a reported bug and addresses
this for people.

Co-Authored-By: xiaojinwei001@163.com

Change-Id: I44283f19823bf39159633fa93f575e306bcf1970
Closes-Bug: #1523742
2016-02-11 19:02:45 +00:00
Andrew Laski e85cf38b94 Improve unit tests for instance multiple create
The unit tests around instance multiple create were faking out the uuid
of the created instances to be aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa.
This worked because the instances are not actually created in the
database so unique constraints aren't violated.

However this led to mocking out the create for the RequestSpec object
which should not have been necessary because there is a database
available to these tests. That would have been fine except that there is
work in progress which relies on the RequestSpec having been written to
the database and getting that to pass tests was starting to rely on
mocks upon mocks upon mocks. Rather than go down that route this unwinds
the test strategy that requires the mocks in the first place.

Change-Id: I356d603bff59d49a9a44c59e0b99f9c16998b37e
2016-02-11 08:28:14 -08:00
Andrew Laski 1aca8b103c Change populate_security_groups to return a SecurityGroupList
populate_security_groups expects an instance object to be passed in and
just sets security_groups on it.  An upcoming change needs this method
to return the SecurityGroupList object instead because it will not be
getting set on the instance at this point.  This simply changes the
method to return the object rather than setting it on the instance.

Change-Id: Ifa40fc061ea041cfcc229ee7255b3c084f3bba6f
2016-02-11 08:28:07 -08:00
Jenkins 7ba2f29463 Merge "Tidy up scheduler_evolution.rst" 2016-02-11 15:06:24 +00:00
Jenkins aeb1631d7e Merge "HyperV: do not log twice with different level." 2016-02-11 15:05:02 +00:00
Jenkins 4c42235e14 Merge "Return HTTP 400 for invalid server-group uuid" 2016-02-11 11:16:06 +00:00