Skip to content

Commit

Permalink
v2v: OVF: Fix list of operating system variants for RHEV >= 3.3 (RHBZ…
Browse files Browse the repository at this point in the history
…#1219857).

Since RHEV 3.3, OS variant names like "RHEL6x64" were deprecated and
replaced by names like "rhel_6x64".  "RHEL7x64" was never valid, and
we should have used "rhel_7x64".  "Windows2012R2x64" was also never
valid and should have been "windows_2012R2x64".

For backwards compatibility, RHEV still understands the old names, and
we still pass them for compatiblity with old RHEV.

However for the new OS variants supported by virt-v2v in RHEL 7.2, use
the new names.

This commit also adds support for SLES and ppc64.

This updates commit 3c51302
and also RHBZ#1213324.
  • Loading branch information
rwmjones committed May 10, 2015
1 parent 61a0217 commit 6f9d5dc
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions v2v/OVF.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,35 @@ let get_vmtype = function

(* Determine the ovf:OperatingSystemSection_Type from libguestfs
* inspection. See ovirt-engine sources, file:
* frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/Enums.properties
* packaging/conf/osinfo-defaults.properties
* and also:
* https://bugzilla.redhat.com/show_bug.cgi?id=1219857#c9
*)
and get_ostype = function
| { i_type = "linux"; i_distro = "rhel"; i_major_version = v;
i_arch = "i386" } ->
i_arch = "i386" } when v <= 6 ->
sprintf "RHEL%d" v

| { i_type = "linux"; i_distro = "rhel"; i_major_version = v;
i_arch = "x86_64" } ->
i_arch = "x86_64" } when v <= 6 ->
sprintf "RHEL%dx64" v

| { i_type = "linux"; i_distro = "rhel"; i_major_version = v;
i_arch = "x86_64" } (* when v >= 7 *) ->
sprintf "rhel_%dx64" v

| { i_type = "linux"; i_distro = "rhel"; i_major_version = 7;
i_arch = "ppc64" | "ppc64le" } ->
"rhel_7_ppc64"

| { i_type = "linux"; i_distro = "sles"; i_major_version = 11;
i_arch = "x86_64" } ->
"sles_11"

| { i_type = "linux"; i_distro = "sles"; i_major_version = 11;
i_arch = "ppc64" | "ppc64le" } ->
"sles_11_ppc64"

| { i_type = "linux" } -> "OtherLinux"

| { i_type = "windows"; i_major_version = 5; i_minor_version = 1 } ->
Expand Down Expand Up @@ -147,19 +165,19 @@ and get_ostype = function

| { i_type = "windows"; i_major_version = 6; i_minor_version = 2;
i_arch = "i386" } ->
"Windows8"
"windows_8"

| { i_type = "windows"; i_major_version = 6; i_minor_version = 2;
i_arch = "x86_64"; i_product_variant = "Client" } ->
"Windows8x64"
"windows_8x64"

| { i_type = "windows"; i_major_version = 6; i_minor_version = 2;
i_arch = "x86_64" } ->
"Windows2012x64"
"windows_2012x64"

| { i_type = "windows"; i_major_version = 6; i_minor_version = 3;
i_arch = "x86_64" } ->
"Windows2012R2x64"
"windows_2012R2x64"

| { i_type = typ; i_distro = distro;
i_major_version = major; i_minor_version = minor;
Expand Down

0 comments on commit 6f9d5dc

Please sign in to comment.