Merge lp:~johannes.erdfelt/nova/vm-mode into lp:~hudson-openstack/nova/trunk
Proposed by
Johannes Erdfelt
Status: | Merged |
---|---|
Approved by: | Brian Waldon |
Approved revision: | 1173 |
Merged at revision: | 1184 |
Proposed branch: | lp:~johannes.erdfelt/nova/vm-mode |
Merge into: | lp:~hudson-openstack/nova/trunk |
Diff against target: |
117 lines (+69/-4) 4 files modified
nova/compute/api.py (+5/-1) nova/db/sqlalchemy/migrate_repo/versions/023_add_vm_mode_to_instances.py (+45/-0) nova/db/sqlalchemy/models.py (+1/-0) nova/virt/xenapi/vmops.py (+18/-3) |
To merge this branch: | bzr merge lp:~johannes.erdfelt/nova/vm-mode |
Related bugs: | |
Related blueprints: |
Explicitly select PV vs HVM mode
(Undefined)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Waldon (community) | Approve | ||
Ed Leafe (community) | Approve | ||
Rick Harris (community) | Approve | ||
Review via email: mp+64215@code.launchpad.net |
Description of the change
The Xen driver supports running instances in PV or HVM modes, but the method it uses to determine which to use is complicated and doesn't work in all cases. The result is that images that need to use HVM mode (such as FreeBSD 64-bit) end up setting a property named 'os' set to 'windows'.
This branch adds checks for a new property called 'vm_mode'. This can be set to 'pv' or 'hvm' and select the appropriate mode. If the property doesn't exist, the existing logic is still used to determine which mode to use.
To post a comment you must log in.
Looks good, nice work Johannes.
I remember at one point we had talked about including virtualization mode as
a separate property. I can't remember exactly why we decided to derive it
from the os_type. It may have had something to do with not exposing the
`vm_mode` directly for some reason or another.
You might want to ping Ant or Cory Wright just to be sure...
> 31 +# Copyright 2010 OpenStack LLC.
s/2010/2011/
> 106 + vm_mode = use_pv_kernel and 'pv' or 'hvm'
Just as a point of comparison, this could also be written using the ternary:
vm_mode = 'pv' if use_pv_kernel else 'hvm'