We neither need nor want these translated so remove them. A couple of
logs with unnecessary brackets or weird indentation were identified in
the process, and these are also modified. Note that exceptions must
still be translated. Refer to [1] for more details.
[1] https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html
Change-Id: I4573a7c5f3a7b5716a15fbd15ad9336807843a03
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Introduce an I/O semaphore to limit the number of concurrent
disk-IO-intensive operations. This could reduce disk contention from
image operations like image download, image format conversion, snapshot
extraction, etc.
The new config option max_concurrent_disk_ops can be set in nova.conf
per compute host and would be virt-driver-agnostic. It is default to 0
which means no limit.
blueprint: io-semaphore-for-concurrent-disk-ops
Change-Id: I897999e8a4601694213f068367eae9608cdc7bbb
Signed-off-by: Jack Ding <jack.ding@windriver.com>
A couple places in the Xen code have been using syntax that is
python2-specific. This replaces those instances with code that will
work in both python2 and python3.
PEP 3108 [1] moves urllib.urlopen to urllib.request.urlopen. The six
module is used in order to work in both python2 and python3 [2].
PEP 3110 [3] changed the grammar for except clauses, such that the
'as' keyword is now required in place of a comma when specifying an
exception variable.
[1] https://www.python.org/dev/peps/pep-3108/
[2] https://pythonhosted.org/six/#module-six.moves.urllib.request
[3] https://www.python.org/dev/peps/pep-3110/
Change-Id: I1235d767718a4207f4cef3e5b140319d003ad7b0
None is not tolerated by ProcessUtils, therefore make sure that [0] is passed as the
expected return code
Change-Id: I7d6335633479dfd7715444ef4aefc85ed41b8fa3
Closes-Bug: #1771137
This commit is to deprecate the config of image_upload_handler
which need to be configured with a class path string. And we
should make download handler be configurable to be consistent
with the upload handler.
So it contains the following changes:
1. deprecate the option of "image_upload_handler".
2. added a new option of "image_handler" which will be used to
choose a short name from the supported image handler plugins.
The proper handler will be loaded at runtime basing on the
option setting.
TODO(jianghuaw): For the legacy handler of VdiThroughDevStore
which has no download function implemented. For downloading, it
is handled in a different way (call xenapi.vm_utils._stream_disk()).
We keep it as it is now. In the future, we should consider to
move _stream_disk to VdiThroughDevStore's download().
Change-Id: I37860e63de32d988525cdc32440fe711777263e6
Blueprint: xenapi-image-handler-option-improvement
I am unsure if I should be concerned about the lack of error
checking here, but this is how it was originally.
Change-Id: I9c1dfd5a90a53d90a44baae4874965bf8f48cea1
blueprint: hurrah-for-privsep
I can't see a good reason for the two drivers to use different
flags, and this simplifies the code a little.
Change-Id: I55cdc22ce8f95dff0cfd1a31b58582fc4b3ea48f
blueprint: hurrah-for-privsep-again
The same pattern as the rest of the changes. This means that privsep now
needs to let you pass flags to e2fsck, which I don't love and will remove
in a later patch.
Change-Id: I6c695c04ae586fec6adc354257638116277dda88
blueprint: hurrah-for-privsep
The previous implementation doesn't support live migration in
pool-based multi-hosts OpenStack environments. Modify code to
support it.
In this patch we will,
1. Support live migration in XAPI pool:
-Add code to support resource pre-check before live migration.
-Add code to support resource clean after live migration.
-Add code to support using local storage in xapi pool.
Depends-On: I80007bb897a1f7eda47ebda82e08fe270f97ff40
Implements: blueprint live-migration-in-xapi-pool
Change-Id: I6437a315f1400a73f7a149bed5550f6d6dd1406f
xenapi likes enabling and disabling ext3 filesystem journals. They can
do that via privsep now.
Change-Id: Iad8198fbd01aa80bde0a6b295963391715c5cd48
blueprint: hurrah-for-privsep
Including updating their unit tests. We can now remove parted from
the rootwrap configuration.
Change-Id: I8cbfe296238976001e38997842059ec2f137f660
blueprint: hurrah-for-privsep
This isn't all calls, but a step along the way. Note that I moved
a xenapi unit test to being the first unit test for privsep directly.
I'm not sure if I love this way of testing (having the "meat" of
the method undecorated and having a wrapper), but I've been unable
to come up with a way to mock away the entrypoint wrapper.
Change-Id: I35d4e7c6c43cbcbc1549aa28796ff97f447a4b03
blueprint: hurrah-for-privsep
This flag was deprecated in a previous cycle. The flag, the feature that
the flag enabled, and a related flag that was not deprecated but should
have been, can now be removed.
Change-Id: I6b38b4e69c0aace4b109f0d083ef665a5c032a15
The virtual block device(VBD) hot unplugging should be done when VM has
paravirtualization(PV) driver installed. But we observed failures with
VM_MISSING_PV_DRIVERS error on a real PV VM sometime.
Actually it's a race condition. At VM booting, it needs some time for
the PV driver to be connected. If the VBD.unplug operation goes before
the PV driver connected to xen, it will failed with VM_MISSING_PV_DRIVERS.
The fix is to retry unplug. If really there is no PV driver installed in
VM, failed after the attempts.
Change-Id: I6b788ba24aa3e7c061dac06c52570ff3818bc91a
Closes-Bug: #1727134
For xenapi driver, there needs to be some way to delete cached
images based on when they were created. add an optional arg to
control delete operation.
Change-Id: I24fc45e989aa951aab55a261fce77f7e3667d988
Closes-bug: 1481689
Add a new filesytem mounting helper in privsep, and then start
moving things across to it. This currently implements mount and
unmount. We get to cleanup some rmdir calls while we're at it
which is nice as well.
I've added an upgrade note mentioning that we no longer ignore
the value of stderr from mount calls, as requesed in code review.
Change-Id: Ib5e585fa4bfb99617cd3ca983674114d323a3cce
blueprint: hurrah-for-privsep
nova.virt.hardware.InstanceInfo had several fields that have never been
used since their inception two and a half years ago [1]. This change set
removes them. They are (were):
max_mem_kb: (int) the maximum memory in KBytes allowed
mem_kb: (int) the memory in KBytes used by the instance
num_cpu: (int) the number of virtual CPUs for the
instance
cpu_time_ns: (int) the CPU time used in nanoseconds
We also rename the 'id' field to 'internal_id' for two reasons: First,
because 'id' is a builtin; second, to emphasize that this is not
(necessarily) tied to the Instance's real id/uuid.
[1] https://review.openstack.org/#/c/133777
Change-Id: I5fe5c8121800e2b8da0860d53d818b7bd83c9e9d
The i18n team has decided not to translate the logs because it
seems like it not very useful; operators prefer to have them in
English so that they can search for those strings on the internet.
Partially fix on nova/virt other paths will be fixed on next commits
Change-Id: Ie7821aa4a5147cdb0616741bd1a1b1fc22080440
With XenAPI driver, bit torrent related configurations are
deprecated since 15.0.0, this patch is to remove it as a
cleanup action under XenAPI driver
Change-Id: I5589f76f397a02a46e45cf571fd180842c0fdf17
This patch is to change nova project to use os-xenapi 0.2.0 which
has added python interfaces for calling dom0 plugins
1. use os_xenapi.client.host_network
2. use os_xenapi.client.disk_management
3. use os_xenapi.client.vm_management
4. use os_xenapi.client.host_xenstore
5. use os_xenapi.client.host_agent
6. use os_xenapi.client.host_management
7. use os_xenapi.client.host_glance
Change-Id: Id87b83ef3ca496525f63b9c7b731e8a22c693e02
New objects are children of NovaObject class. Such parent
will give us a good control of objects versioning. Also it
will force contributors to dump objects version in case of
any changes. These objects will be used to transmit data
via RPC. Old objects were used only for storing data.
During RPC transmission they are transform into dictionaries.
It is not right approach because we will have some problems
in case of adding new diagnostics fields.
Version of compute RPC was bumped.
Also some changes were made in libvirt driver method
get_instance_diagnostics(). These changes were made to fill
new fields of 'Diagnostics' object.
Implementation of method get_instance_diagnostics()
for other virt drivers will be changed in future patches.
blueprint: restore-vm-diagnostics
Change-Id: I5e2d116df045f803c654f7810b939b5fc859cfbf
Some place in Nova, return value has unnecessary parentheses,
or return keyword is not followed by a space when returning a value,
which is a bad format and might be ambigous. For example:
return(1)
return{
'a': 1
}
As noone would write returns like:
return1
return'(empty)'
In this patchset we get rid of this bad formation.
Also, I've added a hacking rule which helps to prevent this in future.
TrivialFix
Change-Id: I4ff85d0240bf8719188ebd06fc0e98a81c1d1203
1.As mentioned in [1], we should avoid using
six.iteritems to achieve iterators. We can
use dict.items instead, as it will return
iterators in PY3 as well. And dict.items/keys
will more readable. 2.In py2, the performance
about list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
The patch list:
1. cells.
2. compute api.
3. image.
4. network.
5. objects.
6. scheduler.
7. virt.
8. other resources.
Partial-Implements: blueprint replace-iteritems-with-items
Change-Id: Ic6e469eb80ee1774de1374bb36f38b5134b6b311
String interpolation should be delayed to be handled
by the logging code, rather than being done
at the point of the logging call.
So add the following hacking rule for it.
- [N354] String interpolation should be delayed at logging calls.
See the oslo i18n guideline.
* http://docs.openstack.org/developer/oslo.i18n/guidelines.html
Change-Id: Ief6d3ee3539c0857098fffdb7acfeec3e0fed6eb
Closes-Bug: #1596829
As of now, UUID is being generated using either uuid.uuid4()
or uuidutils.generate_uuid(). In order to maintain consistency,
we propose to use uuidutils.generate_uuid() from oslo_utils.
Change-Id: I69d4b979fc0e37bc351f9b5516dae899e7e7dba0
All Python files, except executables, should have a '.py' extension.
This wasn't being done for files in the 'plugins/xenserver' folder,
likely because it seems unnatural to call a "plugin" with a file
extension.
Begin working towards a resolution for this by renaming all files to
include a '.py' extension. To avoid forcing operators to upgrade the
Nova service and per-host plugins at the same time, continue to
reference the old, non-'.py' filenames, using symlinks to ensure the
references continue to work. Once Ocata has been released, these
symlinks can be removed, the API version updated and the reference
updated to include the '.py' extension.
Change-Id: Icf4cf2424c15276a6c01778fb92f76bbdc9b2068
Closes-bug: #1302831
This patch adds support for passing the user context through to
vendordata2 to all the other drivers. libvirt got this in the
original patch, so this is a catch up for the others.
Change-Id: I1e1f0aa1a41626970ae3291caaf8d1d1661f68e6
Blueprint: vendordata-reboot
Add the independent compute option and ensure appropriate failure cases
for all incompatible options.
Change-Id: I76c1e3a80da8142639328b204aea5da59551eea3
Implements-blueprint: xenapi-independent-nova
Rather than mounting a guest disk into the compute node,
create the config drive locally and stream it to the
XenServer hypervisor.
Change-Id: I324538decbadf63e78ba86e20e3d41687b0a195a
Implements-Blueprint: xenapi-independent-nova
Move some disk operations from DomU to Dom0 to allow Nova
to run independently from the hypervisor.
Some disk types can be created in Dom0 (e.g. swap, ext3) but
others cannot. Add support here for creating those that can
in Dom0. This will be documented in the independent_compute
config flag in the last patch in this series.
Implements: blueprint xenapi-independent-nova
Change-Id: I634e783a5e19f9710544920e12300b299fc06b36
The config options of the section
"nova/netconf" got moved to the
new central location
"nova/conf/netconf.py"
Change-Id: I8a17b6f00b15e03de55385fc0206bdc82441304a
Depends-On: I0da2ad7daa942b85c3395dc4861c6e18368ece88
Implements: blueprint centralize-config-options-newton
When writing config drive, dd by default uses 512B as the block
size. It costs more than 3mins to write the 64M config drive.
It's longer than expected: Some health checking(fuel's heat
checking) on XenServer may failed due to timeout. So we need
improve the performance via specifying a bigger block size
with dd.
Change-Id: I359e17d6d5838f4028df0bd47e4825de420eb383
Closes-Bug: #1567857
Moves configuration options under nova/virt/xenapi/vm_utils.py to
nova/conf/xenserver.py.
bp centralize-config-options-newton
Change-Id: I2da39474c23466b5755e75667edfd7fc9ea134d2
LOG.warn is deprecated. It still used in a few places.
Updated to non-deprecated LOG.warning.
Change-Id: I42c7b6a172b64a3c1ac6e0703df48ac2ddf8390a
Partial-Bug:#1508442
Image cache should be able to be disabled by setting cache_images = none
in nova.conf. Currently the condition judgment is wrong.
Change-Id: I5ebff2c1f7534b06233a4d41d7f5f2e5e3b60b5a
Closes-Bug: #1161471
Skip creating the formatted log message
if the message is not going to be emitted
because of the log level.
TrivialFix
Change-Id: Iba9f47163a0ac3aca612818272db6d536b238975