summaryrefslogtreecommitdiffstats
path: root/nova/tests/baremetal
Commit message (Collapse)AuthorAgeFilesLines
* Handle IPMI transient failures better.Devananda van der Veen2013-05-142-2/+47
| | | | | | | | | | | | Sometimes, IPMI "power status" doesn't return either "on" or "off". When this happens, the IPMI driver shouldn't assume what the state is, and the baremetal driver shouldn't assume that NOSTATE means SHUTDOWN. This patch also improves the doc strings for the IPMI driver. Fix bug 1178378. Change-Id: I54a5e6309f68ab8e5601e65039366d7d87c03478
* Convert to using newly imported processutils.Michael Still2013-05-081-8/+7
| | | | | | | This change moves nova over to using the newly imported trycmd() and ssh_execute() implementations from oslo's processutils. Change-Id: Ied2bb1eeb0cbdc6903a4028a60c89ca9e23656b4
* Convert to using oslo's execute() method.Michael Still2013-05-041-3/+4
| | | | | | | | There are some small warts (mostly around other execute() like methods which reuse the exception). I will fix these warts in later reviews. Change-Id: Ice9cdbdc5f3e5a9f8365f5d99acf1863a9fe3e7a
* Fix baremetal get_available_nodesDevananda van der Veen2013-04-301-29/+1
| | | | | | | | | | | Baremetal driver get_available_nodes was incorrectly returning only a list of unprovisioned nodes, leading update_availabile_resources to sometimes delete a baremetal node that had an instance provisioned to it -- sometimes even while the provisioning was still in process. Fix bug 1174952 Change-Id: I4f08a2f6539a5b6cd12245ac6b4dc308767ae0cd
* baremetal: VirtualPowerDriver uses mac addresses in bm_interfacesArata Notsu2013-04-151-3/+5
| | | | | | | | | | | After the change I6653829364b0a641442d45e766493180d6f2a880, bm_nodes.prov_mac_address is no longer set. However VPD still uses it. This patch changes VPD to use bm_interfaces.address instead of bm_nodes.prov_mac_address. Fixes bug 1168574. Change-Id: I2bab869b282958ee9fd0e4776928e56351018324
* Merge "baremetal: Integrate provisioning and non-provisioning interfaces"Jenkins2013-04-102-10/+4
|\
| * baremetal: Integrate provisioning and non-provisioning interfacesArata Notsu2013-04-042-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally, baremetal pxe/tilera driver managed two types of network interfaces in two tables; provisioning interfaces in bm_nodes table and non-provisioning (normal) interfaces in bm_interfaces table. But, now actually both types are handled in the same way and there is no difference between them except for which table they are in. This patch moves the provisioning interfaces to bm_interfaces. However it does not drop prov_mac_address in bm_nodes since VirtualPowerManager still uses it to identify a target in a list of VMs returned by the VM's host. Change-Id: I5ce940e7127aa3b29ba7802612938dc5dbc3152f
* | Only call getLogger after configuring logging.Davanum Srinivas2013-04-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | Logging needs to be setup properly before we try to log something. Fix a test case that loads the code but does not execute the code that results in the LOG being setup properly. Fixes LP# 1161031 Change-Id: I9d5bc6b87cfb25243f00e17b532d4485dc4454e4
* | Move console scripts to entrypoints.Monty Taylor2013-04-042-28/+2
|/ | | | | | | | | | | | As part of the move of plugins to entrypoints, take advantage of the entrypoints based console scripts, which will make our command line scripts available for unittesting. Part of blueprint entrypoints-plugins Co-authored-by: Michael Still <mikal@stillhq.com> Change-Id: I5f17348b7b3cc896c92263dd518abb128757d81f
* baremetal: Drop unused columns in bm_nodesArata Notsu2013-04-021-2/+0
| | | | | | | | | | Drop these two columns: * bm_nodes.prov_vlan_id * bm_nodes.registration_status And update related code, tests and api_samples. Change-Id: Iadefc83a00ad9ae5a3bb39f357080299875bdf09
* Delete tests.baremetal.util.new_bm_deployment()Arata Notsu2013-04-011-14/+0
| | | | | | | The function is not used anymore. It creates an instance of BareMetalDeployment, which was removed in c20110d1. Change-Id: I40b634f8cf0d4369f09cb61aca6f95a059e85d6d
* Adds Tilera back-end for baremetalMikyung Kang2013-03-262-0/+538
| | | | | | | | | | | | | | | | | | blueprint add-tilera-to-baremetal. The baremetal driver is a hypervisor driver for Openstack Nova Compute. Within the Openstack framework, it has the same role as the drivers for other hypervisors (libvirt, xen, etc). With this patch set of tilera-backend, provisioning and management of non-PXE tilera physical hardware is accomplished using common cloud APIs and tools. Change-Id: I356c06a07ace463779e3b84836d5000331e24814 Co-authored-by: Mikyung Kang <mkkang@isi.edu> Co-authored-by: David Kang <dkang@isi.edu> Co-authored-by: Ken Igarashi <igarashik@nttdocomo.co.jp> Co-authored-by: Arata Notsu <notsu@virtualtech.jp> Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>
* Correct substring matching of baremetal VPD node namesChris Krelle2013-03-081-13/+28
| | | | | | | | | | | This path corrects a issue where is_power_on function can incorrectly match a node if its name is a substring of another node. I have also added a test for this. fixes bug 1152676 Change-Id: Ic3b0b952d53dcd4464098f98879a84684efe22b2 Authored-by: Chris Krelle <nobodycam@gmail.com>
* Read baremetal images from extra_specs namespace.Devananda van der Veen2013-03-041-12/+13
| | | | | | | | | | Baremetal PXE driver should read deploy_kernel_id & deploy_ramdisk_id from the 'baremetal:' namespace within instance_type['extra_specs'] so that it doesn't conflict with ComputeCapabilitiesFilter any more. Fixes bug 1129485. Change-Id: I84b3acb2ed83dc2b1ff8f1a21ca1d95f7d25751a
* Merge "Add ssh port and key based auth to VPD."Jenkins2013-03-031-1/+20
|\
| * Add ssh port and key based auth to VPD.Chris Krelle2013-03-031-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the ablity to set ssh port, and use key based authentication for VPD. This patch adds config options: virtual_power_ssh_port: port to ssh to on virtual power host virtual_power_host_key: private key file for ssh auth Note: Key file must be able to be read by user nova is running as. This patch switches the default virtual_power_type from 'vbox' to 'virsh' to match the most common usage. Fix Bug 1136010 Change-Id: Id89878d63d26602bb3eacc2a2ce7902d9bd33d61 Authored-by: Chris Krelle <nobodycam@gmail.com>
* | Add instance_type_get() to virt apiDan Smith2013-02-281-16/+33
|/ | | | | | | | | | ...and remove the use of instance['extra_specs'] from the libvirt and baremetal virt drivers. Also remove the hack in instance_update() which places them there in the first place. Fixes bug 1133572 Change-Id: I39e9fabb28b48dc52ec47f58d76b0bf2c6ee0204
* Update OpenStack LLC to FoundationKurt Taylor2013-02-262-2/+2
| | | | | | Update all references of "LLC" to "Foundation". Change-Id: I009e86784ef4dcf38882d64b0eff484576e04efe
* Sync nova with oslo DB exception cleanup.Chris Behrens2013-02-253-7/+7
| | | | | | | | | | | | | DB exceptions have moved to openstack/common/db/exception module so that they can be shared with multiple DB implementations. Deadlock checking was also added to oslo to consolidate with DuplicateKey checking. This allows us to clean up our _retry_on_deadlock decorator in sqlalchemy/api.py Fixes unrelated pep8 issue with duplicate test in test_compute also. Change-Id: I7e985b384d1ef345e0d67c919b84b4faff869699
* Remove function redefinitionsStanislaw Pitucha2013-02-211-1/+1
| | | | | | | | | | A number of tests have never been run due to another function having the same name. Duplicate names have been changed and additionally pyflakes check will now fail in such situations. Also fix ovs ethernet driver test which was incorrect. Change-Id: Icd93528395e65a24194a6ec5dfb8025a820d29b5
* Baremetal driver returns accurate list of instanceDevananda van der Veen2013-02-201-0/+47
| | | | | | | | | | | | | | | | Add 'instance_name' to bm_nodes table so that baremetal driver is able to return the names of all instances it believes are still running. Previously, baremetal.driver.list_instances was fetching all allocated instances from baremetal database, then calling VirtAPI to get the instance name. This would raise an InstanceNotFound exception for deleted instances. This prevented ComputeManager from ever detecting a running-but-deleted baremetal instance, and could leave baremetal instances in an undeletable state. Fixes bug 1096723. Change-Id: Ifae532e8e70e97e48c589608cb3c7000bb6a7609
* Identify baremetal nodes by UUID.Devananda van der Veen2013-02-203-13/+22
| | | | | | | | | | | | | | | | | - add a new 'uuid' column to 'bm_nodes' table - provide a new db/api method for accessing nodes by their uuid - return this to Nova as the nodename / hypervisor_hostname In this way, a baremetal node is uniquely identified to the user, whether they use a per-compute baremetal db or global baremetal db. It will also allow for an instance to be booted on a specific baremetal node using a means akin to the current force-hosts (TBD in later patch). Also, creates two new Exceptions to disambiguate between InstanceNotFound and NodeNotFound / NodeNotFoundByUUID. Change-Id: I81105a201588fdef31cffabdae260bb43017bcd1
* Improve performance of baremetal list_instances.Devananda van der Veen2013-02-202-62/+146
| | | | | | | | | | | | | | This patch adds two new methods to baremetal/db/api: - bm_node_get_associated - bm_node_get_unassociated which return a list of nodes either associated or not associated to a Nova instance, as determined by the instance_uuid field, respectively. Now, list_instances and get_available_nodes methods only fetch assocated and unassociated nodes from the baremetal database, instead of fetching all nodes. Change-Id: Ib875d26d7b85a9dbf08c925a89802e2cd614e363
* Better error handling in baremetal spawn & destroyDevananda van der Veen2013-02-201-0/+44
| | | | | | | | | | Improve the exception handling in baremetal driver spawn and destroy. Adds unit tests for destroy to check that bm_node is disassociated from instance_uuid only when destroy succeeds, and is set to ERROR state (but still associated) if any exception is not handled. Change-Id: I75853210d4883b352da9876a682dbb7288689541
* Wait for baremetal deploy inside driver.spawnDevananda van der Veen2013-02-201-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, baremetal driver.spawn returned as soon as the machine power turned on, but before the user-image was deployed to the hardware node, and long before the node was available on the network. This meant the nova instance was marked as ACTIVE before provisioning had actually finished. If the deploy failed and the baremetal node was set to an ERROR state, the nova instance could still be left as ACTIVE and the user was never informed of the error. This patch introduces a LoopingCall to monitor the deployment status in the baremetal database. As the deployment is performed by nova-baremetal-deploy-helper, the database record is updated. Once the deployment is complete, driver.spawn() sets the baremetal node status and the nova instance status is also set properly. If an error occurs during the deployment, an exception is raised within driver.spawn() allowing nova to follow the normal cleanup and notify paths. This also allows the baremetal PXE driver to delete cached image files when a baremetal deployment fails. Fixes bug 1088655. Change-Id: I4feefd462fd956c9780995ec8b05b13e78278c8b
* Add better status to baremetal deployments.Devananda van der Veen2013-02-202-45/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a few new baremetal states, which are used to track the deploy process. Now, nova-baremetal-deploy-helper updates the bm_nodes record directly when it begins and finishes deploying an image to that node. The next patch will add a LoopingCall inside driver.spawn() to wait for the deploy to complete. Also, since there can not be >1 active deployment per node, there is no need to have a separate table for storing them. This patch drops the table bm_deployments and adds the important information it contained to bm_nodes. Since the previous behavior was to mark a deployment as deleted once it completed, there is no need to copy any data from bm_deployments prior to dropping the table -- assuming that no active deployments are in process when the migration is run. Since this is the first migration for the baremetal database, it also adds a new test class, TestBaremetalMigrations, and refactors the test_migrations.py file to allow for multiple test classes. partially implements fix for bug 1096723 Change-Id: Iad30b462d49c88fc19babed43a2fb8540b1fad30
* Use oslo-config-2013.1b4Mark McLoughlin2013-02-196-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | The cfg API is now available via the oslo-config library, so switch to it and remove the copied-and-pasted version. Add the 2013.1b4 tarball to tools/pip-requires - this will be changed to 'oslo-config>=2013.1' when oslo-config is published to pypi. This will happen in time for grizzly final. Add dependency_links to setup.py so that oslo-config can be installed from the tarball URL specified in pip-requires. Remove the 'deps = pep8==1.3.3' from tox.ini as it means all the other deps get installed with easy_install which can't install oslo-config from the URL. Make tools/hacking.py include oslo in IMPORT_EXCEPTIONS like it already does for paste. It turns out imp.find_module() doesn't correct handle namespace packages. Retain dummy cfg.py file until keystoneclient middleware has been updated (I18c450174277c8e2d15ed93879da6cd92074c27a). Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
* Delete baremetal interfaces when their parent node is deletedArata Notsu2013-02-151-0/+34
| | | | Change-Id: I504cbed0adea86cab840c40ea9b9f96faf299f73
* VirtualPowerDriver catches ProcessExecutionError.Devananda van der Veen2013-02-141-38/+47
| | | | | | | | Baremetal virtual_power_driver now catches ProcessExecutionError coming from ssh_execute and logs an exception. Requested actions (eg, power_on) return an error state instead of raising an exception. Change-Id: I8f66ba843e12de13f9a14d736f7bef2eda4ef85c
* Merge "Remove nova.db call from baremetal PXE driver"Jenkins2013-02-091-10/+11
|\
| * Remove nova.db call from baremetal PXE driverDevananda van der Veen2013-02-071-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | Baremetal PXE driver was fetching instance_type from the nova db. Now that no-db-compute is done, that's not possible. Also, there's a more efficient way -- just call extract_instance_type(instance)! Baremetal unit tests should check for instance_types with swap = 0 and with swap > 0. This required changing test/utils to include a real copy of instance_types in instance['system_metadata']. Change-Id: I2a91e5c026782946f6b01e4189ec85d30ba87583
* | Merge "Add a virtual PowerDriver for Baremetal testing"Jenkins2013-02-091-0/+358
|\ \ | |/ |/|
| * Add a virtual PowerDriver for Baremetal testingChris Krelle2013-02-071-0/+358
| | | | | | | | | | | | | | | | | | | | | | | | This virtual_power_driver provides the ability for baremetal driver to start/stop/reboot VMs within common dev/test environments. Its goal is to approximate the same functionality as other PowerDrivers (eg. IPMI) within a desktop development environments and within the devstack-gate environment. Authored-by: Chris Krelle <nobodycam@gmail.com> Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com> Change-Id: I9935a9a30a166a9c28a9abb139c49f219a32ddd7
* | Use oslo database codeEric Windisch2013-02-053-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Bring in the new database code from oslo. Uses get_session() from oslo as well as changing NovaBase to derive from a common class. Remove test_sqlalchemy.py now that this code is test in oslo. Implements blueprint db-common. Change-Id: I090754981c871250dd981cbbe1a08e7181440120
* | Make sure there are no unused importJoe Gordon2013-01-283-9/+0
| | | | | | | | | | | | | | Remove all currently unused imports Prevent future unused imports Change-Id: I6ac26d5c71b79952a7732db300355a00310c712e
* | Merge "Baremetal/utils should not log certain exceptions"Jenkins2013-01-261-0/+36
|\ \
| * | Baremetal/utils should not log certain exceptionsDevananda van der Veen2013-01-211-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unlink_without_raise was logging exceptions when it failed to unlink a file, which is confusing since it is often called on non-existing files. create_link_without_raise was also logging exceptions when it failed to create a symlink. This patch corrects this behaviour; both functions now explicitly check for the type of error they expect, and then suppress that. If another type of OSError is encountered, a warning is logged. This patch also adds unit tests for both functions. fixes bug 1097931. Change-Id: Ie36f59dce34a6c67765770c5f968c003003acc88
* | | Merge "PXE driver should rmtree directories it created"Jenkins2013-01-261-5/+8
|\ \ \
| * | | PXE driver should rmtree directories it createdDevananda van der Veen2013-01-211-5/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Baremetal PXE driver was failing to delete the per-instance tftpboot and image directories which it created when the instance was deleted. This happened partly because of dangling files within the directory, and partly because 'unlink' does not remove directories and the error was squelched. Now, when destroy()ing an instance, PXE driver will call shutil.rmtree() on the per-instance directories which it created. Fixes bug 1101048. Change-Id: I682d0264288add488ea23e5d5200357b7be52dd9
* | | Enable N302: Import modules onlyJoe Gordon2013-01-251-16/+13
| | | | | | | | | | | | | | | | | | Fix all N302 issues, and re-enable. Change-Id: Ic94d144c915b228b7ff2fd9c5951875e159ffcdd
* | | Merge "Tests for PXE bare-metal provisioning helper server."Jenkins2013-01-221-0/+256
|\ \ \ | |/ / |/| |
| * | Tests for PXE bare-metal provisioning helper server.Mikyung Kang2013-01-111-0/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a part of blueprint general-bare-metal-provisioning-framework. The deploy helper was landed without tests. This patch reinstates the tests. Change-Id: I690ec077e175dc37c2cc5f18170513b0e5bca103 Co-authored-by: Mikyung Kang <mkkang@isi.edu> Co-authored-by: David Kang <dkang@isi.edu> Co-authored-by: Ken Igarashi <igarashik@nttdocomo.co.jp> Co-authored-by: Arata Notsu <notsu@virtualtech.jp> Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>
* | | Merge "PXE driver should not accept empty kernel UUID."Jenkins2013-01-211-0/+18
|\ \ \
| * | | PXE driver should not accept empty kernel UUID.Devananda van der Veen2013-01-171-0/+18
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Baremetal PXE driver was aborting only if the kernel and ramdisk specified in image metadata were None, but not if they were another non-true value, such as "". Now, exception is raised if they are any non-true value. Fix bug 1100589. Change-Id: I9783a14cc242e1b9db04d797c61d54b06d52c680
* / | Remove obsolete baremetal override of MAC addresses.Robert Collins2013-01-181-17/+0
|/ / | | | | | | | | | | | | | | Now that the hypervisor driver can specify what MAC addresses it needs, overriding the MAC address during bare metal instance provisioning is no longer appropriate. Change-Id: I2b0790753297104ddd40a410c8acb5fdac97ad15
* / Export the MAC addresses of nodes for bare-metal.Robert Collins2013-01-151-0/+13
|/ | | | | | | | | | | | | | | | | The bare-metal hypervisor needs to let the network layer know the MAC address of each node it has, or TFTP boot will fail, as the MAC addresses quantum / nova dynamically allocate will not match the actual MAC of the node as it boots. This change exports the MAC addresses to the manager, which passes them onto the network driver in use. With this change administrators should register all the MAC addresses of a given node with Nova bare-metal as interfaces, even though that may duplicate the MAC for PXE boot provisioning. Long term the dedicated provisioning MAC address will be removed. Change-Id: I55f6031294a2c5d31975462f868aa27441e11ad2
* CLI for bare-metal database sync.Mikyung Kang2013-01-081-0/+49
| | | | | | | | | | Part 3 of 6: blueprint general-bare-metal-provisioning-framework. Change-Id: Ia19ce00edb84aa924c2ab2c9c2217f6b49073d69 Co-authored-by: Mikyung Kang <mkkang@isi.edu> Co-authored-by: David Kang <dkang@isi.edu> Co-authored-by: Ken Igarashi <igarashik@nttdocomo.co.jp> Co-authored-by: Arata Notsu <notsu@virtualtech.jp>
* Convert short doc strings to be on one lineDevananda van der Veen2013-01-085-15/+5
| | | | | | | This patch just cleans up some one-line doc strings which were split across 3 lines needlessly. Change-Id: I3c2011d20fb7c3b8714d7b5a32151e427bf8a311
* Provide a PXE NodeDriver for the Baremetal driverDevananda van der Veen2013-01-072-0/+570
| | | | | | | | | | | | | This patch implements a PXE NodeDriver class within the Baremetal provisioning framework, which provides a means for deploying machine images using TFTP and PXE. This patch relies on functionality provided by the nova-baremetal-deploy-helper utility, implemented in review 15830. blueprint general-bare-metal-provisioning-framework. Change-Id: I8d849601186e3dc13f10382857ff2bbc1ff1026d
* Removes unused importsZhongyue Luo2013-01-032-11/+2
| | | | Change-Id: I76d243329f810cdcd6f8a5459eb66fddd5871e33