summaryrefslogtreecommitdiff
path: root/nova/virt/xenapi_conn.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix issue starting nova-compute w/ XenServerBrian Lamar2012-02-281-18/+1
| | | | | | | | | | In a fresh-install environment, nova-compute will fail to start due to missing record in compute_nodes table. I have moved the db update to be included in the update_available_resources function. Fixes bug 942893 Change-Id: I4b4f6a493ef0bbe81224c7408d0985e14fa9f1bc
* Add hypervisor_hostname to compute_nodes table and use it in XenServer.Josh Kearney2012-02-231-1/+18
| | | | | | This ensures the dom0 hostname is available to the API even when dom0 is "offline." Change-Id: I1230c1871606fadc30f63ed97b56d54e51fd8833
* blueprint host-aggregates: host maintenance - xenapi implementationArmando Migliaccio2012-02-231-66/+10
| | | | | | | | | | this changeset introduces the following: - refactoring around host-related operations for xenapi - increased test coverage - first cut at implementing host evacuation for a XS/XCP host Change-Id: I8509cdde95f6777ecfa928663b0c4bedbccf5d38
* Merge "Move get_info to taking an instance."Jenkins2012-02-231-2/+2
|\
| * Move get_info to taking an instance.Michael Still2012-02-221-2/+2
| | | | | | | | | | | | | | This is a first step towards using uuids in this interface instead of instance names (which are synonyms for instance ids). Change-Id: I54b32a5020b0dbc21ba7156ed38ed188c483086b
* | blueprint host-aggregates: improvements and clean-upArmando Migliaccio2012-02-221-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset addresses a number of issues found during testing: - avoid name conflicts during aggregate creation (see db/* changes) - avoid masking of XenAPI.Failure if pool-join fails (see plugins/* changes) - preserve VM placement decisions made during scheduling (see xenapi/vmops.py) - ensure plugins are called on the right hosts in XS pools (see xenapi_con.py) - stores master uuid in aggregate metadata for use in VM live migration and raise InvalidAction rather than Aggregate error if we attempt to remove a mster (see xenapi/pool.py and compute/manager.py) - clean-up of unit tests Change-Id: I881a94d87efe1e81bd4f86667e75f5cbee50ce91
* | blueprint host-aggregates: xenapi implementationArmando Migliaccio2012-02-211-3/+24
|/ | | | | | | | | | | | | | | | | | This commit introduces some clean-up/improvements on the current model and api for host aggregates. It also introduces a first version of the xenapi implementation. More precisely: - it lays out the structure of the virt driver, - it introduces compute and xenapi unit tests coverage, - it deals with join/eject of pool master and slaves, - it fixes xenapi_conn, when used in resource pool configurations More commits to follow (to ensure that VM placement, networking setup, performance metrics work just as well in cases where resource pools are present). However, these may be outside the scope of this blueprint and considered as ad-hoc bug fixes. Change-Id: Ib3cff71160264c5547e1c060d3fd566ad87337cb
* Fixes nova-volume support for multiple lunsVishvananda Ishaya2012-02-161-1/+1
| | | | | | | | | | | | | * stores lun in provider_location if specified * passes lun in iscsi_properties instead of hard coding * adds call to libvirt to list all used block devices * make sure to synchronize connect and disconnect commands * only disconnect from target if no luns are in use * allow double logins to targets * fixes typo in get_volume_connector in xenapi_connection * fixes bug 929790 Change-Id: I2466dc750a6fa5e0b07f94314d38873740aa6b29
* Added resize support for Libvirt/KVM.Nachi Ueno2012-02-141-2/+4
| | | | | | Implements blueprint libvirt-resize This implmenation using scp to copy VM image, so scp command and ssh-pub-key s Change-Id: I6450e5bbc5a33abc9ef55cf04366280bd1c5241e
* Standardize logging delaration and useJason Kölker2012-02-141-1/+1
| | | | | | * Make modules use getLogger(__name__) and log to the result Change-Id: Ib6d69b4be140ec89affc86ed11e65e422d551df1
* Remove the last of the gflags shim layerMark McLoughlin2012-02-101-1/+1
| | | | | | | Make FLAGS a ConfigOpts instance and fix up all the places where we expected FlagValues behaviour. Change-Id: I8f96f42e0d8d30ba6b362d29861e717cf0fa9e89
* Merge "Backslash continuations (nova.virt)"Jenkins2012-02-101-4/+4
|\
| * Backslash continuations (nova.virt)Zhongyue Luo2012-02-081-4/+4
| | | | | | | | | | | | | | | | Fixes bug #925283 Backslash continuations removal for package nova.virt Change-Id: Ia47eae3b80d90cdac044e2f875d7ece8ed9ad715
* | Stop using LoopingCall in nova.virt.xenapi_conn:wait_for_task()Johannes Erdfelt2012-02-081-45/+35
|/ | | | | | | | | The use of utils.LoopingCall is unnecessary since code waits immediately for the LoopingCall to finish. This results in code that is more complicated than necessary, but also it creates an extra greenthread that ends up obfuscating stack trace in case of exceptions. Change-Id: Iaf0909a4f2307e8657e7baa15cb5a7852ba6feca
* Remove ajaxterm from NovaThierry Carrez2012-02-071-5/+1
| | | | | | | | | | Removes copy of ajaxterm code, nova-ajax-console-proxy, and support for get_ajax_console from Nova proper. Implements blueprint remove-ajaxterm Fixes bug 917963 Change-Id: I2c0ff427c53c0f63a18b10475d6b4cbe9a085d83
* Fix _poll_bandwidth_usage if no network on vifJason Kölker2012-02-061-7/+3
| | | | | | | | | | | | 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
* Add initiator to initialize_connectionVishvananda Ishaya2012-02-041-0/+15
| | | | | | | | | | | | | | | | | | Some volumes need to know the name of the initiator that will be connecting to the iscsi volume. This adds a call down to the hypervisor driver to get the ip and the initiator name for the vm before calling initialize connection. This connection is passed down to the volume driver so that it can be used to authenticate when the hypervisor tries to connect to the volume. * Adds initiator initialize_connection * Makes a call to driver to get initiator name and ip address * Gets initiator from openiscsi for libvirt * Gets initiator from config for xenapi * Add tests for the driver calls * Fixes bug 924461 Change-Id: I5b6a2dd84560c7f7b447571e0abf0993e5512ca0
* Move cfg to nova.openstack.commonMark McLoughlin2012-02-031-1/+1
| | | | | | | | | | | | | | | 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
* Make sure multiple calls to _get_session() aren't nestedJohannes Erdfelt2012-02-011-1/+5
| | | | | | | | | | | | Fixes bug 924918 async_call_plugin() acquires a xenapi session as does the nested call to get_xenapi_host(). This can cause a deadlock if multiple greenthreads all block waiting for the outer sessions to be freed to allocate the inner session. This change moves the call to get_xenapi_host() to outside the with statement to ensure calls to _get_session() aren't nested. Change-Id: I8f5490f40a9ccaf74a276187f66519a5d5f52b2e
* Refactor away the flags.DEFINE_* helpersMark McLoughlin2012-01-281-61/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Blueprint xenapi-provider-firewall and Bug #915403.Deepak Garg2012-01-241-0/+3
| | | | | | | | | | | | 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
* ComputeNode Capacity supportSandy Walsh2012-01-231-1/+1
| | | | | | | | | | | | | | | | | | 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
* Implements blueprint vnc-console-cleanupAnthony Young2012-01-171-0/+9
| | | | | | | | | | | | | | | * Creates a unified way to access vnc consoles for xenserver and libvirt * Now supports both java and websocket clients * Removes nova-vncproxy - a replacement version of this (nova-novncproxy) can be found as described in vncconsole.rst * Adds nova-xvpvncproxy, which supports a java vnc client * Adds api extension to access java and novnc access_urls * Fixes proxy server to close/shutdown sockets more cleanly * Address style feedback * Use new-style extension format * Fix setup.py * utils.gen_uuid must be wrapped like str(utils.gen_uuid()) or it can't be serialized Change-Id: I5e42e2f160e8e3476269bd64b0e8aa77e66c918c
* Unbreak start instance and fixes bug 905270Isaku Yamahata2012-01-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the bug 905270 https://bugs.launchpad.net/nova/+bug/905270 According to EC2 documentation, EBS-instances that initiated shutdown result in stopped state. And then it can be started again. (On the other hand non-EBS instance result in terminted when instance initiated shutdown) However, the current nova case, the shutdowned instance always results in terminated status. As related issues are - describe-instance-attribute instance_initiated_shutdown_behavior doesn't work correctly - instance attribute disable_api_termination isn't supported - stop instance was broken by the change set of the following. It needs unbreak. > commit eb03d47fecd3bfc24243da29ee01679b334a08fe > Author: Vishvananda Ishaya <vishvananda@gmail.com> > Date: Fri Sep 23 09:22:32 2011 -0700 > > Remove AoE, Clean up volume code > > * Removes Ata Over Ethernet > * Adds drivers to libvirt for volumes > * Adds initialize_connection and terminate_connection to volume api > * Passes connection info back through volume api > > Change-Id: I1b1626f40bebe8466ab410fb174683293c7c474f This patch - unbreak start instance - implement instance_initiated_shutdown_behavior and make it EC2 compatible - implement disable_api_termination --- Changes 5 -> 6: - fixes to catch up 26b7b9457a5899ecca93fd67d3879efcad4e4968 Changes 4 -> 5: - HACKING compilance Changes 3 -> 4: - rebased to 4c5586a28fd7a085369c49f6039876ffdc86b526 sqlalchemy migrate version Changes 2 -> 3: - rename long name to shorter one s/instance_initiated_shutdown_behavior/shutdown_terminate/g s/disable_api_termination/disable_terminate/g as suggested Kevin L. Mitchell - improved nova.api.ec2.cloud._state_description - pep8 - broken out patches are available for easy review at git://github.com/yamahata/nova.git lp905270-2 Changes 1 -> 2: - fixed an unit test failure pointed out by Mark. (I think ebtabls failure strongly suggests installation problem) - introduce vm_states.SHUTOFF and put instance state which is in power_state.{NOSTATE, SHUTOFF} into vm_states.SHUTOFF. - simplified logic a bit by vm_states.SHUTOFF as suggested by Vish. - instance_initiated_shutdown_behavior:String(255) => instance_initiated_shutdown_terminate:Boolean() as suggested by Vish. - Added Johannes Erdfelt to reviews as they written the vm_states state machine checker. I'd have liked to add David Subiros either, but he doesn't seem to be a registered user of the gerrit. Change-Id: Ibeb94f65137feadad2c343913b39195e3f96a35e
* Blueprint xenapi-security-groupsSalvatore Orlando2012-01-101-2/+20
| | | | | | | | | | | | Provides two drivers for implementing security groups in xenapi: 1) domU driver that enforces security groups on the Openstack virtual appliance (use advised with FlatDHCP in HA mode) 2) dom0 driver that enforces security groups where VIFs are attached Both drivers translate security groups into iptables rules. Existing libvirt code has been refactored to reduce the amount of duplicated code to a minimum Now Addressing reviewers's comments on style. Fixing issue spotted with snapshots Change-Id: Ifa16a8f2508a709be03241bac0f942fe1a51d1e8
* Make various methods staticJulien Danjou2011-12-141-1/+2
| | | | | | | | A lot of stuff in nova.virt contain methods that are actually static. Marking them this way makes the code clearer. Change-Id: I287058d3b2315562f2980999239fcd3240d2b1ec Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
* Merge "Renaming instance_actions.instance_id column to instance_uuid. ↵Jenkins2011-12-131-5/+6
|\ | | | | | | blueprint: internal-uuids"
| * Renaming instance_actions.instance_id column to instance_uuid.Naveed Massjouni2011-12-131-5/+6
| | | | | | | | | | | | blueprint: internal-uuids Change-Id: I204c3fd49278c509a9bc32353445ede086cfadb2
* | bug 899767: fix vif-plugging with live migrationDan Wendlandt2011-12-121-0/+5
|/ | | | | | | | Expose vif_unplug method in virt layer, as the compute manager has to explicitly call it on during live migration, so that network devices are torn down even if the disk image is not. Change-Id: Iae88c72f4fd2c7c097c23ef9e5f8fd392052f73e
* Fix race condition in XenAPI when using <object>.get_allJohannes Erdfelt2011-12-071-1/+1
| | | | | | | | | | | Fixes bug 887708 There are a handful of places where <object>.get_all is followed by a <object>.get_record calls that are potentially racey. This patch fixes all of these cases to use common code that is tolerant of HANDLE_INVALID errors that would be indicative of a race between get_all and delete Change-Id: Ib94adb6d21b6b55e7b26fc1da52ed46d9dba8275
* Implement resize down for XenAPIJohannes Erdfelt2011-12-021-2/+4
| | | | | | | | This patch implements resizing an instance to a smaller disk. It implements this by copying the VDI and running e2resize, before transferring to the new host. Change-Id: Ic901a59cb6cdb79605c70528cf85064d8335ee2f
* Merge "Fixing get_info method implementations in virt drivers to accept ↵Jenkins2011-12-011-2/+2
|\ | | | | | | instance_name instead of instance_id. The abstract class virt.ComputeDriver defines get_info as: def get_info(self, instance_name). blueprint: internal-uuids"
| * Fixing get_info method implementations in virt drivers to acceptNaveed Massjouni2011-11-301-2/+2
| | | | | | | | | | | | | | | | | | instance_name instead of instance_id. The abstract class virt.ComputeDriver defines get_info as: def get_info(self, instance_name). blueprint: internal-uuids Change-Id: Ibe5e19f038e66f12711654eab48ba620aae4ace6
* | Adds missing image_meta to rescue's spawn() calls.Josh Kearney2011-11-301-2/+2
|/ | | | Change-Id: Id769c217611011d77abafa529c306f780475aaf4
* Fixes LP878319Jason Kölker2011-11-091-1/+10
| | | | | | | * Adds lookup of host version in XenAPI session * Add call to determine function name of resize Change-Id: I797ff2ea34a3b3fde1091efba803a4572aaf1ede
* Reducing the number of compute calls to GlanceBrian Waldon2011-11-091-4/+4
| | | | | | Fixes bug 886224 Change-Id: Ibd270d24eb68cc2503fee933a2154125995d352d
* Merge "Added code to libvirt backend to report state info."Jenkins2011-11-081-3/+3
|\
| * Added code to libvirt backend to report state info.Lorin Hochstein2011-10-271-3/+3
| | | | | | | | | | | | | | | | | | Also renamed property variable in Xen code to make it consistent with nova conventions. Implements blueprint kvm-report-capabilities Change-Id: I7953e857d9b8ce4b410c31b82cead7aaa3fb911f
* | flatten distributed schedulerSandy Walsh2011-11-011-2/+41
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This branch removes AbstractScheduler, BaseScheduler and LeastCostScheduler and replaces it with DistributedScheduler. Now the points of extension are handled via the --default_host_filters and --least_cost_functions only. Also, greatly simplified the zone handling logic in DistibutedScheduler, mostly by removing the cryptic dicts with helper classes. Fixed up the Least Cost functions to better deal with multiple functions. (In a followup patch I will removed the normalization that occurs as this will be a problem). Tests were mostly rewritten to support this new world order. Debated removing JSONFilter since it's not accessible from the outside world, but decided to keep it as there are discussions afoot on making scheduler changes without having to redeploy code or restart services. HostFilters once again get the all the host service capabilities, but now via a HostInfo class that mostly contains read-only dicts of capabilities. Virtual resource consumption is done in the DistributedScheduler class now. The filters/weighing functions don't need to worry about this. Also, weighing functions only have to return a single host and not worry about the number of instances requested. Change-Id: I92600a4a9c58b1add775c328a18d8f48c305861e
* Removed callback concept on VM driver methods:Brian Lamar2011-10-251-12/+12
| | | | | | | | | | | | | * pause * unpause * suspend * resume * rescue * unrescue Worked off blueprint remove-virt-driver-callbacks Change-Id: Ie3ef4c8155320f72106d7a39e5817516e180ba52
* Fix concurrency of XenAPI sessionsJohannes Erdfelt2011-10-241-21/+39
| | | | | | | | | | | Fixes bug 879044 Nova currently does not serialize access to the XenAPI session which can result in multiple (green)threads trying to use the same HTTP connection. This will typically only affect Python 2.7 which has updated xmlrpclib to try to use one HTTP connection for multiple requests. Change-Id: I101d63b822c8bf8c28674a836e4b54aa8259e1a8
* Only log instance actions once if instance action logging is enabled (now ↵Josh Kearney2011-10-191-6/+16
| | | | | | | | disabled by default). Fixes bug 874487. Change-Id: I25b4e82bd71ab8073953d5ddbcb013757619d548
* Adds the ability to automatically issue a hard reboot to instances that have ↵Josh Kearney2011-10-131-0/+4
| | | | | | | | been stuck in a 'rebooting' state for longer than a specified window. Fixes bug 873099. Change-Id: Ife2c64326fdb3ec849242583d1bd1d96f9f4be0f
* Adds more usage data to Nova's usage notifications.Monsyne Dragon2011-10-121-0/+20
| | | | | | | | | | Adds in bandwidth, state and IP data on standard notifications, and new notifications on add/remove IP. These were missing before, and are needed to meet spec. This fixes bug 849117 Change-Id: Ie586ff3a91a56e5f5eff8abc6905ba6a0b624451
* Remove AoE, Clean up volume codeVishvananda Ishaya2011-10-111-7/+10
| | | | | | | | | * Removes Ata Over Ethernet * Adds drivers to libvirt for volumes * Adds initialize_connection and terminate_connection to volume api * Passes connection info back through volume api Change-Id: I1b1626f40bebe8466ab410fb174683293c7c474f
* Fixing testsRick Harris2011-09-211-0/+12
|\
| * Instance deletions in Openstack are immediate. This can cause data to be ↵Johannes Erdfelt2011-09-211-0/+8
| |\ | | | | | | | | | | | | | | | | | | lost accidentally. This branch adds a new configuration flag, reclaim_instance_interval. The default of 0 results in the same behavior before this patch, immediate deletion of the instance. Any value greater than 0 will result in the instance being powered off immediately and then later the instance will be reclaimed. New actions, restore and forceDelete allow a previously deleted instance to be restored, or reclaimed immediately.
| | * Merge with trunkJohannes Erdfelt2011-09-121-2/+2
| | |\
| | * | Implement deferred delete of instancesJohannes Erdfelt2011-09-061-0/+8
| | | |
| * | | Added virt-level support for polling unconfirmed resizes.Josh Kearney2011-09-151-0/+4
| | |/ | |/|