You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2019/07/11 15:56:49 UTC

[vcl] branch develop updated (39d199f -> 728c285)

This is an automated email from the ASF dual-hosted git repository.

jfthomps pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/vcl.git.


    from 39d199f  Ubuntu.pm: commented out get_network_configuration so that base version of function in Linux.pm will be used instead; the output of ifconfig changed in Ubuntu 18 such that the base function worked better for older and newer versions of Ubuntu
     new 003aef7  VCL-1120 - image conversion from vmdk to qcow2 always done twice
     new 655566b  libvirt.pm: modified power_off: added check for "SIGKILL: Device or resource busy" in output of virsh destroy command - we've experienced times when a domain was considered busy but could be destroyed a few seconds later, this waits 30 seconds and tries again
     new 94426df  Windows.pm: modified disable_automatic_updates: added "AUOptions"=dword:00000001 to registry key that gets set; we encountered times when it seemed a VM was doing automatic updates and this is a different option to disable automatic updates
     new 728c285  Ubuntu.pm: fixed comment added in last commit

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm   |  2 +-
 managementnode/lib/VCL/Module/OS/Windows.pm        |  1 +
 .../lib/VCL/Module/Provisioning/libvirt.pm         | 38 ++++++++++++++++++++++
 .../lib/VCL/Module/Provisioning/libvirt/KVM.pm     | 12 ++++++-
 4 files changed, 51 insertions(+), 2 deletions(-)


[vcl] 02/04: libvirt.pm: modified power_off: added check for "SIGKILL: Device or resource busy" in output of virsh destroy command - we've experienced times when a domain was considered busy but could be destroyed a few seconds later, this waits 30 seconds and tries again

Posted by jf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jfthomps pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/vcl.git

commit 655566bd1fb0c9996e17e25fc2b6fa4c2bd164d5
Author: Josh Thompson <jf...@ncsu.edu>
AuthorDate: Thu Jul 11 11:51:10 2019 -0400

    libvirt.pm: modified power_off: added check for "SIGKILL: Device or resource busy" in output of virsh destroy command - we've experienced times when a domain was considered busy but could be destroyed a few seconds later, this waits 30 seconds and tries again
---
 .../lib/VCL/Module/Provisioning/libvirt.pm         | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/managementnode/lib/VCL/Module/Provisioning/libvirt.pm b/managementnode/lib/VCL/Module/Provisioning/libvirt.pm
index bee452d..04cccc6 100644
--- a/managementnode/lib/VCL/Module/Provisioning/libvirt.pm
+++ b/managementnode/lib/VCL/Module/Provisioning/libvirt.pm
@@ -779,6 +779,44 @@ sub power_off {
 		notify($ERRORS{'DEBUG'}, 0, "'$domain_name' domain is not running on $node_name");
 		return 1;
 	}
+	elsif (grep(/SIGKILL: Device or resource busy/i, @$output)) {
+		notify($ERRORS{'DEBUG'}, 0, "Failed to stop '$domain_name' domain; \"SIGKILL: Device or resource busy\" encountered, waiting 30 seconds and trying again");
+		# libvirt could not kill VM, wait and try again
+		sleep 30;
+		my $command2 = "virsh -q list --all";
+		($exit_status, $output) = $self->vmhost_os->execute($command2);
+		my ($id, $name, $state);
+		for my $line (@$output) {
+			($id, $name, $state) = $line =~ /^\s*([\d\-]+)\s+(.+?)\s+(\w+|shut off|in shutdown)$/g;
+			next if (!defined($id));
+			last if ($name eq $domain_name);
+		}
+		if ($name ne $domain_name) {
+			notify($ERRORS{'WARNING'}, 0, "2nd try: $domain_name not found when running 'virsh list' on $node_name");
+			return;
+		}
+		if ($id eq '-') {
+			notify($ERRORS{'DEBUG'}, 0, "'$domain_name' domain now stopped");
+			return 1;
+		}
+		($exit_status, $output) = $self->vmhost_os->execute($command);
+		if (!defined($output)) {
+			notify($ERRORS{'WARNING'}, 0, "2nd try: failed to execute virsh command to destroy '$domain_name' domain on $node_name");
+			return;
+		}
+		elsif ($exit_status eq '0') {
+			notify($ERRORS{'OK'}, 0, "2nd try: destroyed '$domain_name' domain on $node_name");
+			return 1;
+		}
+		elsif (grep(/domain is not running/i, @$output)) {
+			notify($ERRORS{'DEBUG'}, 0, "2nd try: '$domain_name' domain is not running on $node_name");
+			return 1;
+		}
+		else {
+			notify($ERRORS{'WARNING'}, 0, "2nd try: failed to destroy '$domain_name' domain on $node_name\ncommand: $command\nexit status: $exit_status\noutput:\n" . join("\n", @$output));
+			return;
+		}
+	}
 	else {
 		notify($ERRORS{'WARNING'}, 0, "failed to destroy '$domain_name' domain on $node_name\ncommand: $command\nexit status: $exit_status\noutput:\n" . join("\n", @$output));
 		return;


[vcl] 04/04: Ubuntu.pm: fixed comment added in last commit

Posted by jf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jfthomps pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/vcl.git

commit 728c28546c9eb6ac42f2fe83b042b607207e25c0
Author: Josh Thompson <jf...@ncsu.edu>
AuthorDate: Thu Jul 11 11:55:21 2019 -0400

    Ubuntu.pm: fixed comment added in last commit
---
 managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm b/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
index 0b73160..3df350b 100644
--- a/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
+++ b/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
@@ -154,7 +154,7 @@ sub set_password {
 
 =cut
 
-=head2 comment out this get_network_configuration to use version of function in Linux.
+=head2 comment out this get_network_configuration to use version of function in Linux.pm
 sub get_network_configuration {
 	my $self = shift;
 	if (ref($self) !~ /VCL::Module/i) {


[vcl] 01/04: VCL-1120 - image conversion from vmdk to qcow2 always done twice

Posted by jf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jfthomps pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/vcl.git

commit 003aef7ec7d1fe28cbb2f1992d1e40cfb22b2a1f
Author: Josh Thompson <jf...@ncsu.edu>
AuthorDate: Thu Jul 11 11:48:04 2019 -0400

    VCL-1120 - image conversion from vmdk to qcow2 always done twice
    
    KVM.pm: modified copy_virtual_disk: added code to change file to be converted to parent .vmdk file if it exists instead of list of -sXXX files; added check for "Invalid parameter.*compt" when checking output of image conversion command as error message changed in a newer version of qemu-img
---
 managementnode/lib/VCL/Module/Provisioning/libvirt/KVM.pm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/managementnode/lib/VCL/Module/Provisioning/libvirt/KVM.pm b/managementnode/lib/VCL/Module/Provisioning/libvirt/KVM.pm
index e57cabd..decfb4d 100644
--- a/managementnode/lib/VCL/Module/Provisioning/libvirt/KVM.pm
+++ b/managementnode/lib/VCL/Module/Provisioning/libvirt/KVM.pm
@@ -599,6 +599,14 @@ sub copy_virtual_disk {
 		$source_file_paths_string = '"' . join('" "', @source_file_paths) . '"';
 	#}
 	
+	my $parent_file = $source_file_name;
+	$parent_file =~ s/-s[0-9]{3}//;
+	$parent_file = $parent_file . ".vmdk";
+	if ($self->vmhost_os->file_exists("$source_directory_path$parent_file")) {
+		$source_file_paths_string = "$source_directory_path$parent_file";
+		notify($ERRORS{'DEBUG'}, 0, "changing source_file_paths_string from multiple files to $source_directory_path$parent_file");
+	}
+	
 	my $options = '';
 	# VCL-911: If copying to the repository, save the image qcow2 version 0.10, the traditional image format that can be read by any QEMU since 0.10
 	my $repository_image_file_path = $self->get_repository_image_file_path();
@@ -621,7 +629,9 @@ sub copy_virtual_disk {
 	
 	my $start_time = time;
 	my ($exit_status, $output) = $self->vmhost_os->execute($command, 0, 7200);
-	if (defined($output) && grep(/Unknown option.*compat/, @$output)) {
+	if (defined($output) &&
+	   (grep(/Unknown option.*compat/, @$output) ||
+	   grep(/Invalid parameter.*compat/, @$output))) {
 		# Check for older versions which don't support '-o compat=':
 		#    Unknown option 'compat'
 		#    qemu-img: Invalid options for file format 'qcow2'.


[vcl] 03/04: Windows.pm: modified disable_automatic_updates: added "AUOptions"=dword:00000001 to registry key that gets set; we encountered times when it seemed a VM was doing automatic updates and this is a different option to disable automatic updates

Posted by jf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jfthomps pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/vcl.git

commit 94426dfaaee4e288d22464301618e790b2f28008
Author: Josh Thompson <jf...@ncsu.edu>
AuthorDate: Thu Jul 11 11:53:05 2019 -0400

    Windows.pm: modified disable_automatic_updates: added "AUOptions"=dword:00000001 to registry key that gets set; we encountered times when it seemed a VM was doing automatic updates and this is a different option to disable automatic updates
---
 managementnode/lib/VCL/Module/OS/Windows.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/managementnode/lib/VCL/Module/OS/Windows.pm b/managementnode/lib/VCL/Module/OS/Windows.pm
index a6eac08..dde48d7 100644
--- a/managementnode/lib/VCL/Module/OS/Windows.pm
+++ b/managementnode/lib/VCL/Module/OS/Windows.pm
@@ -8353,6 +8353,7 @@ Windows Registry Editor Version 5.00
 
 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]
 "NoAutoUpdate"=dword:00000001
+"AUOptions"=dword:00000001
 EOF
 
 	# Import the string into the registry