[PATCH 0/2] Uninstall Parallels Tools for Linux
Pavel Butsykin (2): increase the default memory size to 768 MB v2v: linux: uninstall Parallels tools src/guestfs-internal.h | 2 +- v2v/convert_linux.ml | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) -- 2.8.3
The appliance memory size of 500 MB is insufficient in certain scenarios. In partiuclar, semodule (which may be called by a guest tools uninstaller) often triggers OOM (see https://bugzilla.redhat.com/426775) Increase it to 768 MB. Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> --- src/guestfs-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 03f1034..1d1b996 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -93,7 +93,7 @@ /* The default and minimum memory size for most users. */ #ifndef DEFAULT_MEMSIZE -# define DEFAULT_MEMSIZE 500 +# define DEFAULT_MEMSIZE 768 #endif #ifndef MIN_MEMSIZE # define MIN_MEMSIZE 128 -- 2.8.3
On Sat, Jun 11, 2016 at 08:51:56PM +0300, Pavel Butsykin wrote:
The appliance memory size of 500 MB is insufficient in certain scenarios. In partiuclar, semodule (which may be called by a guest tools uninstaller) often triggers OOM (see https://bugzilla.redhat.com/426775)
Increase it to 768 MB.
Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> --- src/guestfs-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 03f1034..1d1b996 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -93,7 +93,7 @@
/* The default and minimum memory size for most users. */ #ifndef DEFAULT_MEMSIZE -# define DEFAULT_MEMSIZE 500 +# define DEFAULT_MEMSIZE 768 #endif #ifndef MIN_MEMSIZE # define MIN_MEMSIZE 128
If only we had a more sensible way to allocate memory :-( Anyway, this patch needs to remove the earlier lines which set DEFAULT_MEMSIZE to 768 on __powerpc__ and __aarch64__. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On Sat, Jun 11, 2016 at 09:35:40PM +0100, Richard W.M. Jones wrote:
On Sat, Jun 11, 2016 at 08:51:56PM +0300, Pavel Butsykin wrote:
The appliance memory size of 500 MB is insufficient in certain scenarios. In partiuclar, semodule (which may be called by a guest tools uninstaller) often triggers OOM (see https://bugzilla.redhat.com/426775)
Increase it to 768 MB.
Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> --- src/guestfs-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 03f1034..1d1b996 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -93,7 +93,7 @@
/* The default and minimum memory size for most users. */ #ifndef DEFAULT_MEMSIZE -# define DEFAULT_MEMSIZE 500 +# define DEFAULT_MEMSIZE 768 #endif #ifndef MIN_MEMSIZE # define MIN_MEMSIZE 128
If only we had a more sensible way to allocate memory :-(
Anyway, this patch needs to remove the earlier lines which set DEFAULT_MEMSIZE to 768 on __powerpc__ and __aarch64__.
When I thought about this a bit more, I think what you want is to just increase the memory limit for virt-v2v. How about the attached? (Only compile tested.) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On 12.06.2016 15:01, Richard W.M. Jones wrote:
On Sat, Jun 11, 2016 at 09:35:40PM +0100, Richard W.M. Jones wrote:
On Sat, Jun 11, 2016 at 08:51:56PM +0300, Pavel Butsykin wrote:
The appliance memory size of 500 MB is insufficient in certain scenarios. In partiuclar, semodule (which may be called by a guest tools uninstaller) often triggers OOM (see https://bugzilla.redhat.com/426775)
Increase it to 768 MB.
Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> --- src/guestfs-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 03f1034..1d1b996 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -93,7 +93,7 @@
/* The default and minimum memory size for most users. */ #ifndef DEFAULT_MEMSIZE -# define DEFAULT_MEMSIZE 500 +# define DEFAULT_MEMSIZE 768 #endif #ifndef MIN_MEMSIZE # define MIN_MEMSIZE 128
If only we had a more sensible way to allocate memory :-(
Anyway, this patch needs to remove the earlier lines which set DEFAULT_MEMSIZE to 768 on __powerpc__ and __aarch64__.
When I thought about this a bit more, I think what you want is to just increase the memory limit for virt-v2v. How about the attached? (Only compile tested.)
Yes, that's right, I'm just here to follow the rule - the simpler the better :) Your solution is more correct, because it allows to go to the next step, to make this knowledge outward. The caller may know better need extra memory or not. For example, in the context of this issue, we do not need additional memory for windows guests.
Rich.
On Tue, Jun 14, 2016 at 11:56:16AM +0300, Pavel Butsykin wrote:
Yes, that's right, I'm just here to follow the rule - the simpler the better :) Your solution is more correct, because it allows to go to the next step, to make this knowledge outward. The caller may know better need extra memory or not. For example, in the context of this issue, we do not need additional memory for windows guests.
FWIW this is the final patch I went with: https://github.com/libguestfs/libguestfs/commit/08f82f2e3d6975b72340dd59f438... It will allocate 800MB on x86-64. Note that actual usage should be smaller since KVM will allocate the RAM only if the guest tries to use it. Also we have a few tricks coming soon like using DAX in the next version of qemu[1]. It's difficult to make the amount vary by guest type, since virt-v2v doesn't know the guest type until it has inspected it, which happens after the appliance has been launched. Rich. [1] https://www.redhat.com/archives/libguestfs/2016-May/msg00138.html -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Guest tools for Linux in Parallels / Virtuozzo Server 6 come with a script that can be used to uninstall them. Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> --- v2v/convert_linux.ml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index 7eef2ab..681466e 100644 --- a/v2v/convert_linux.ml +++ b/v2v/convert_linux.ml @@ -694,6 +694,20 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps = ignore (g#command [| "/sbin/chkconfig"; "kudzu"; "off" |]) ) + and unconfigure_prltools () = + let prltools_path = "/usr/lib/parallels-tools/install" in + if g#is_file ~followsymlinks:true prltools_path then ( + try + ignore (g#command [| prltools_path; "-r" |]); + + (* Reload Augeas to detect changes made by prltools uninst. *) + Linux.augeas_reload g + with + G.Error msg -> + warning (f_"Parallels tools was detected, but uninstallation failed. The error message was: %s (ignored)") + msg + ) + and configure_kernel () = (* Previously this function would try to install kernels, but we * don't do that any longer. @@ -1414,6 +1428,7 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps = unconfigure_vmware (); unconfigure_citrix (); unconfigure_kudzu (); + unconfigure_prltools (); let kernel, virtio = configure_kernel () in -- 2.8.3
On Sat, Jun 11, 2016 at 08:51:57PM +0300, Pavel Butsykin wrote:
Guest tools for Linux in Parallels / Virtuozzo Server 6 come with a script that can be used to uninstall them.
Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> --- v2v/convert_linux.ml | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index 7eef2ab..681466e 100644 --- a/v2v/convert_linux.ml +++ b/v2v/convert_linux.ml @@ -694,6 +694,20 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps = ignore (g#command [| "/sbin/chkconfig"; "kudzu"; "off" |]) )
+ and unconfigure_prltools () = + let prltools_path = "/usr/lib/parallels-tools/install" in + if g#is_file ~followsymlinks:true prltools_path then ( + try + ignore (g#command [| prltools_path; "-r" |]); + + (* Reload Augeas to detect changes made by prltools uninst. *) + Linux.augeas_reload g + with + G.Error msg -> + warning (f_"Parallels tools was detected, but uninstallation failed. The error message was: %s (ignored)") + msg + ) + and configure_kernel () = (* Previously this function would try to install kernels, but we * don't do that any longer. @@ -1414,6 +1428,7 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps = unconfigure_vmware (); unconfigure_citrix (); unconfigure_kudzu (); + unconfigure_prltools ();
let kernel, virtio = configure_kernel () in
I have pushed this patch. Thanks for your contribution. I will look at the other more complex patch series later -- tomorrow hopefully. My apologies for the mailing list delays/filtering -- this is because spammers try to sign up for the list to spam it, so we have to moderate initial messages. Every mail from should go though without any delays now. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
On 11.06.2016 23:38, Richard W.M. Jones wrote:
On Sat, Jun 11, 2016 at 08:51:57PM +0300, Pavel Butsykin wrote:
Guest tools for Linux in Parallels / Virtuozzo Server 6 come with a script that can be used to uninstall them.
Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> --- v2v/convert_linux.ml | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index 7eef2ab..681466e 100644 --- a/v2v/convert_linux.ml +++ b/v2v/convert_linux.ml @@ -694,6 +694,20 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps = ignore (g#command [| "/sbin/chkconfig"; "kudzu"; "off" |]) )
+ and unconfigure_prltools () = + let prltools_path = "/usr/lib/parallels-tools/install" in + if g#is_file ~followsymlinks:true prltools_path then ( + try + ignore (g#command [| prltools_path; "-r" |]); + + (* Reload Augeas to detect changes made by prltools uninst. *) + Linux.augeas_reload g + with + G.Error msg -> + warning (f_"Parallels tools was detected, but uninstallation failed. The error message was: %s (ignored)") + msg + ) + and configure_kernel () = (* Previously this function would try to install kernels, but we * don't do that any longer. @@ -1414,6 +1428,7 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps = unconfigure_vmware (); unconfigure_citrix (); unconfigure_kudzu (); + unconfigure_prltools ();
let kernel, virtio = configure_kernel () in
I have pushed this patch.
Thanks for your contribution.
I will look at the other more complex patch series later -- tomorrow hopefully.
My apologies for the mailing list delays/filtering -- this is because spammers try to sign up for the list to spam it, so we have to moderate initial messages. Every mail from should go though without any delays now.
NP :) Thanks for the review.
Rich.
participants (2)
-
Pavel Butsykin -
Richard W.M. Jones