OpenStack Compute (Nova)
Go to file
Kashyap Chamarthy de512f2c02 libvirt: Add a default VirtIO-RNG device to guests
tl;dr: We're adding the default VirtIO-RNG device to ensure guests are
       not starved of entropy (and thus not hang) during boot time.

Background
----------

From Nova Git history, commit b94550f419 ("libvirt: configuration
element for a random number generator device") _did_ add a default RNG
device (but with its entropy source to the undesirable '/dev/random').
However, the default RNG device was immediately removed in another
commit (605677c -- "libvirt: remove explicit /dev/random rng default"),
with this rationale:

    libvirt (or rather qemu) will default to /dev/random if no rng device
    path is specified [...]

    It's preferable for us to not duplicate this default to allow for a
    future where libvirt or the hypervisor needs to make more intelligent
    decisions about the default device to use.

The above reasoning doesn't hold up, because:

(a) libvirt does not make "policy" decisions, such as choosing an
    entropy source (or any other such).  Therefore Nova, as a management
    application, should make the decision here.

(b) More importantly, when QEMU exposes a VirtIO-RNG device to the
    guest, that device needs a source of entropy; and QEMU by default
    uses the legacy and problematic `/dev/random` as the source —
    instead of the preferred `/dev/urandom`.  So QEMU's default for
    VirtIO-RNG devices is not sufficient, and Nova should not rely on
    it.  (Discussion[+] on 'qemu-devel' list to consider changing QEMU's
    default.)

                    * * *

In this patch:

  - Make Nova configure a VirtIO-RNG device by default for guests.
    (Which will be using `/dev/urandom` as the default entropy source.)
    This will also work for Windows guests, when using VirtIO-Win
    drivers[*] on the Linux host.

  - The 'hw_rng_model' image metadata property is now rendered
    (temporarily) useless -- as it's not used anywhere outside the
    _add_rng_device() method.  But we don't want to deprecate it yet, as
    we may extend it (see code comment for details); docucment that.

[*] https://docs.pagure.org/docs-fedora/create-windows-vms-using-virtio.html
[+] https://lists.nongnu.org/archive/html/qemu-devel/2018-09/msg02724.html
    -- "[RFC] Virtio RNG: Consider changing the default entropy source to
    /dev/urandom?"

Closes-Bug: #1789868

Change-Id: I28e66c9640c38d23b8c0dbd0b05f5260bfcf6d30
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
2020-01-23 13:24:52 +01:00
api-guide/source Merge "Fix typos in nova doc" 2020-01-10 23:27:11 +00:00
api-ref/source Merge "Remove 'nova-xvpvncproxy'" 2020-01-08 06:27:03 +00:00
devstack Merge "Find instance in another cell during floating IP re-association" 2019-09-13 15:19:55 +00:00
doc Merge "Print help if nova-manage subcommand is not specified" 2020-01-15 01:55:37 +00:00
etc/nova nova-net: Kill it 2020-01-14 21:25:56 +00:00
gate Convert legacy nova-live-migration and nova-multinode-grenade to py3 2019-11-14 16:06:02 +00:00
nova libvirt: Add a default VirtIO-RNG device to guests 2020-01-23 13:24:52 +01:00
playbooks Enable cross-cell resize in the nova-multi-cell job 2019-12-23 10:10:57 -05:00
releasenotes libvirt: Add a default VirtIO-RNG device to guests 2020-01-23 13:24:52 +01:00
roles Enable cross-cell resize in the nova-multi-cell job 2019-12-23 10:10:57 -05:00
tools Keep pre-commit inline with hacking and fix whitespace 2019-12-12 14:56:39 +00:00
.coveragerc Remove nova/openstack/* from .coveragerc 2016-10-12 16:20:49 -04:00
.gitignore Delete the placement code 2019-04-28 20:06:15 +00:00
.gitreview OpenDev Migration Patch 2019-04-19 19:45:52 +00:00
.mailmap Add mailmap entry 2014-05-07 12:14:26 -07:00
.pre-commit-config.yaml pre-commit: Use Python 3 to run checks 2020-01-14 14:59:08 +00:00
.stestr.conf Finish stestr migration 2017-11-24 16:51:12 -05:00
.zuul.yaml Merge "Restore test_minbw_allocation_placement in nova-next job" 2020-01-03 20:45:45 +00:00
CONTRIBUTING.rst Update links in documents 2018-01-12 17:05:11 +08:00
HACKING.rst Merge "Make it easier to run a selection of tests relevant to ongoing work" 2019-11-22 20:58:18 +00:00
LICENSE initial commit 2010-05-27 23:05:26 -07:00
MAINTAINERS Fix broken URLs 2017-09-07 15:42:31 +02:00
README.rst Start README.rst with a better title 2019-11-19 17:29:28 +01:00
babel.cfg Get rid of distutils.extra. 2012-02-08 19:30:39 -08:00
bindep.txt Added openssh-client into bindep 2019-10-23 07:21:23 +00:00
lower-constraints.txt nova-net: Kill it 2020-01-14 21:25:56 +00:00
requirements.txt Merge "Report trait 'COMPUTE_IMAGE_TYPE_PLOOP'" 2020-01-07 05:29:24 +00:00
setup.cfg nova-net: Kill it 2020-01-14 21:25:56 +00:00
setup.py Updated from global requirements 2017-03-02 11:50:48 +00:00
test-requirements.txt nova-net: Kill it 2020-01-14 21:25:56 +00:00
tox.ini Stop testing Python 2 2019-11-18 10:31:06 +00:00

README.rst

OpenStack Nova

image

OpenStack Nova provides a cloud computing fabric controller, supporting a wide variety of compute technologies, including: libvirt (KVM, Xen, LXC and more), Hyper-V, VMware, XenServer, OpenStack Ironic and PowerVM.

Use the following resources to learn more.

API

To learn how to use Nova's API, consult the documentation available online at:

For more information on OpenStack APIs, SDKs and CLIs in general, refer to:

Operators

To learn how to deploy and configure OpenStack Nova, consult the documentation available online at:

In the unfortunate event that bugs are discovered, they should be reported to the appropriate bug tracker. If you obtained the software from a 3rd party operating system vendor, it is often wise to use their own bug tracker for reporting problems. In all other cases use the master OpenStack bug tracker, available at:

Developers

For information on how to contribute to Nova, please see the contents of the CONTRIBUTING.rst.

Any new code must follow the development guidelines detailed in the HACKING.rst file, and pass all unit tests.

Further developer focused documentation is available at:

Other Information

During each Summit and Project Team Gathering, we agree on what the whole community wants to focus on for the upcoming release. The plans for nova can be found at: