Blame SOURCES/0008-RHEL-Disable-o-glance.patch

7bddab
From 95640bac1c00014f94bec5539907fd92d7379ad2 Mon Sep 17 00:00:00 2001
7bddab
From: "Richard W.M. Jones" <rjones@redhat.com>
7bddab
Date: Wed, 30 Jun 2021 11:15:52 +0100
7bddab
Subject: [PATCH] RHEL: Disable -o glance
7bddab
7bddab
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1977539
7bddab
---
7bddab
 docs/virt-v2v-output-openstack.pod | 56 ++----------------------------
7bddab
 docs/virt-v2v.pod                  | 20 -----------
7bddab
 output/output_glance.mli           |  2 +-
7bddab
 tests/test-v2v-o-glance.sh         |  3 ++
7bddab
 v2v/v2v.ml                         |  7 +---
7bddab
 5 files changed, 7 insertions(+), 81 deletions(-)
7bddab
7bddab
diff --git a/docs/virt-v2v-output-openstack.pod b/docs/virt-v2v-output-openstack.pod
7bddab
index f5a3abad..1ab356e8 100644
7bddab
--- a/docs/virt-v2v-output-openstack.pod
7bddab
+++ b/docs/virt-v2v-output-openstack.pod
7bddab
@@ -10,13 +10,10 @@ virt-v2v-output-openstack - Using virt-v2v to convert guests to OpenStack
7bddab
                         [-oo verify-server-certificate=false]
7bddab
                         [-oo os-username=admin] [-oo os-*=*]
7bddab
 
7bddab
- virt-v2v [-i* options] -o glance
7bddab
-
7bddab
 =head1 DESCRIPTION
7bddab
 
7bddab
 This page documents how to use L<virt-v2v(1)> to convert guests to run
7bddab
-on OpenStack.  There are two output modes you can select, but only
7bddab
-I<-o openstack> should be used normally.
7bddab
+on OpenStack.
7bddab
 
7bddab
 =over 4
7bddab
 
7bddab
@@ -27,15 +24,6 @@ Full description: L</OUTPUT TO OPENSTACK>
7bddab
 This is the modern method for uploading to OpenStack via the REST API.
7bddab
 Guests can be directly converted into Cinder volumes.
7bddab
 
7bddab
-=item B<-o glance>
7bddab
-
7bddab
-Full description: L</OUTPUT TO GLANCE>
7bddab
-
7bddab
-This is the old method for uploading to Glance.  Unfortunately Glance
7bddab
-is not well suited to storing converted guests (since virt-v2v deals
7bddab
-with "pets" not templated "cattle"), so this method is not recommended
7bddab
-unless you really know what you are doing.
7bddab
-
7bddab
 =back
7bddab
 
7bddab
 =head1 OUTPUT TO OPENSTACK
7bddab
@@ -170,50 +158,10 @@ no Cinder volume type is used.
7bddab
 The following options are B<not> supported with OpenStack: I<-oa>,
7bddab
 I<-of>.
7bddab
 
7bddab
-=head1 OUTPUT TO GLANCE
7bddab
-
7bddab
-Note this is a legacy option.  In most cases you should use
7bddab
-L</OUTPUT TO OPENSTACK> instead.
7bddab
-
7bddab
-To output to OpenStack Glance, use the I<-o glance> option.
7bddab
-
7bddab
-This runs the L<glance(1)> CLI program which must be installed on the
7bddab
-virt-v2v conversion host.  For authentication to work, you will need
7bddab
-to set C<OS_*> environment variables.
7bddab
-
7bddab
-Normally there is a file called C<overcloudrc> or C<keystonerc_admin>
7bddab
-which you can simply C<source> to set everything up.
7bddab
-
7bddab
-Virt-v2v adds metadata for the guest to Glance, describing such things
7bddab
-as the guest operating system and what drivers it requires.  The
7bddab
-command C<glance image-show> will display the metadata as "Property"
7bddab
-fields such as C<os_type> and C<hw_disk_bus>.
7bddab
-
7bddab
-=head2 Glance and sparseness
7bddab
-
7bddab
-Glance image upload doesn't appear to correctly handle sparseness.
7bddab
-For this reason, using qcow2 will be faster and use less space on the
7bddab
-Glance server.  Use the virt-v2v S<I<-of qcow2>> option.
7bddab
-
7bddab
-=head2 Glance and multiple disks
7bddab
-
7bddab
-If the guest has a single disk, then the name of the disk in Glance
7bddab
-will be the name of the guest.  You can control this using the I<-on>
7bddab
-option.
7bddab
-
7bddab
-Glance doesn't have a concept of associating multiple disks with a
7bddab
-single guest, and Nova doesn't allow you to boot a guest from multiple
7bddab
-Glance disks either.  If the guest has multiple disks, then the first
7bddab
-(assumed to be the system disk) will have the name of the guest, and
7bddab
-the second and subsequent data disks will be called
7bddab
-C<I<guestname>-disk2>, C<I<guestname>-disk3> etc.  It may be best to
7bddab
-leave the system disk in Glance, and import the data disks to Cinder.
7bddab
-
7bddab
 =head1 SEE ALSO
7bddab
 
7bddab
 L<virt-v2v(1)>,
7bddab
-L<https://docs.openstack.org/python-openstackclient/latest/cli/man/openstack.html>,
7bddab
-L<glance(1)>.
7bddab
+L<https://docs.openstack.org/python-openstackclient/latest/cli/man/openstack.html>.
7bddab
 
7bddab
 =head1 AUTHOR
7bddab
 
7bddab
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
7bddab
index 9b1e44a1..a1e00db8 100644
7bddab
--- a/docs/virt-v2v.pod
7bddab
+++ b/docs/virt-v2v.pod
7bddab
@@ -431,14 +431,6 @@ See L</Networks and bridges> below.
7bddab
 
7bddab
 This is the same as I<-o local>.
7bddab
 
7bddab
-=item B<-o> B<glance>
7bddab
-
7bddab
-This is a legacy option.  You should probably use I<-o openstack>
7bddab
-instead.
7bddab
-
7bddab
-Set the output method to OpenStack Glance.  In this mode the converted
7bddab
-guest is uploaded to Glance.  See L<virt-v2v-output-openstack(1)>.
7bddab
-
7bddab
 =item B<-o> B<json>
7bddab
 
7bddab
 Set the output method to I<json>.
7bddab
@@ -1170,11 +1162,6 @@ and output methods may use disk space, as outlined in the table below.
7bddab
 This temporarily places a full copy of the uncompressed source disks
7bddab
 in C<$VIRT_V2V_TMPDIR> (or F).
7bddab
 
7bddab
-=item I<-o glance>
7bddab
-
7bddab
-This temporarily places a full copy of the output disks in
7bddab
-C<$VIRT_V2V_TMPDIR> (or F).
7bddab
-
7bddab
 =item I<-o local>
7bddab
 
7bddab
 =item I<-o qemu>
7bddab
@@ -1358,13 +1345,6 @@ instance.
7bddab
 Because of how Cinder volumes are presented as F</dev> block devices,
7bddab
 using I<-o openstack> normally requires that virt-v2v is run as root.
7bddab
 
7bddab
-=item Writing to Glance
7bddab
-
7bddab
-This does I<not> need root (in fact it probably won’t work), but may
7bddab
-require either a special user and/or for you to source a script that
7bddab
-sets authentication environment variables.  Consult the Glance
7bddab
-documentation.
7bddab
-
7bddab
 =item Writing to block devices
7bddab
 
7bddab
 This normally requires root.  See the next section.
7bddab
diff --git a/output/output_glance.mli b/output/output_glance.mli
7bddab
index 972320a2..9befc461 100644
7bddab
--- a/output/output_glance.mli
7bddab
+++ b/output/output_glance.mli
7bddab
@@ -18,4 +18,4 @@
7bddab
 
7bddab
 (** [-o glance] output mode. *)
7bddab
 
7bddab
-module Glance : Output.OUTPUT
7bddab
+(*module Glance : Output.OUTPUT*)
7bddab
diff --git a/tests/test-v2v-o-glance.sh b/tests/test-v2v-o-glance.sh
7bddab
index c0db9115..074b5e16 100755
7bddab
--- a/tests/test-v2v-o-glance.sh
7bddab
+++ b/tests/test-v2v-o-glance.sh
7bddab
@@ -20,6 +20,9 @@
7bddab
 
7bddab
 set -e
7bddab
 
7bddab
+# Feature is disabled in RHEL 9.
7bddab
+exit 77
7bddab
+
7bddab
 source ./functions.sh
7bddab
 set -e
7bddab
 set -x
7bddab
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
7bddab
index a66fa285..c9ddce36 100644
7bddab
--- a/v2v/v2v.ml
7bddab
+++ b/v2v/v2v.ml
7bddab
@@ -205,7 +205,6 @@ let rec main () =
7bddab
     if !output_mode <> `Not_set then
7bddab
       error (f_"%s option used more than once on the command line") "-o";
7bddab
     match mode with
7bddab
-    | "glance" -> output_mode := `Glance
7bddab
     | "libvirt" -> output_mode := `Libvirt
7bddab
     | "disk" | "local" -> output_mode := `Disk
7bddab
     | "json" -> output_mode := `JSON
7bddab
@@ -257,7 +256,7 @@ let rec main () =
7bddab
       s_"Map network ‘in’ to ‘out’";
7bddab
     [ L"no-trim" ],  Getopt.String ("-", no_trim_warning),
7bddab
       s_"Ignored for backwards compatibility";
7bddab
-    [ S 'o' ],       Getopt.String ("glance|json|libvirt|local|null|openstack|qemu|rhv|rhv-upload|vdsm", set_output_mode),
7bddab
+    [ S 'o' ],       Getopt.String ("json|libvirt|local|null|openstack|qemu|rhv|rhv-upload|vdsm", set_output_mode),
7bddab
       s_"Set output mode (default: libvirt)";
7bddab
     [ M"oa" ],       Getopt.String ("sparse|preallocated", set_output_alloc),
7bddab
                                     s_"Set output allocation mode";
7bddab
@@ -325,8 +324,6 @@ virt-v2v -i libvirtxml guest-domain.xml -o local -os /var/tmp
7bddab
 
7bddab
 virt-v2v -i disk disk.img -o local -os /var/tmp
7bddab
 
7bddab
-virt-v2v -i disk disk.img -o glance
7bddab
-
7bddab
 There is a companion front-end called \"virt-p2v\" which comes as an
7bddab
 ISO or CD image that can be booted on physical machines.
7bddab
 
7bddab
@@ -396,7 +393,6 @@ read the man page virt-v2v(1).
7bddab
       pr "input:libvirtxml\n";
7bddab
       pr "input:ova\n";
7bddab
       pr "input:vmx\n";
7bddab
-      pr "output:glance\n";
7bddab
       pr "output:json\n";
7bddab
       pr "output:libvirt\n";
7bddab
       pr "output:local\n";
7bddab
@@ -486,7 +482,6 @@ read the man page virt-v2v(1).
7bddab
     | `Disk -> (module Output_disk.Disk)
7bddab
     | `Null -> (module Output_null.Null)
7bddab
     | `QEmu -> (module Output_qemu.QEMU)
7bddab
-    | `Glance -> (module Output_glance.Glance)
7bddab
     | `Openstack -> (module Output_openstack.Openstack)
7bddab
     | `RHV_Upload -> (module Output_rhv_upload.RHVUpload)
7bddab
     | `RHV -> (module Output_rhv.RHV)
7bddab
-- 
7bddab
2.31.1
7bddab