summaryrefslogtreecommitdiff
path: root/nova/virt/hyperv/pathutils.py
diff options
context:
space:
mode:
authorLucian Petrut <lpetrut@cloudbasesolutions.com>2015-01-05 16:38:10 +0200
committerLucian Petrut <lpetrut@cloudbasesolutions.com>2016-05-20 18:59:23 +0300
commite215e6cba9922e98cb358891a3f9be2e809d770f (patch)
tree4454838e0eced743005e3d0c8ebd440b6060e1b0 /nova/virt/hyperv/pathutils.py
parentf554c3f777701be44fe3c3406cca2435f9e79557 (diff)
downloadnova-e215e6cba9922e98cb358891a3f9be2e809d770f.tar.gz
HyperV: Nova serial console access support
Hyper-V provides a solid interface for accessing serial ports via named pipes, already employed in the Nova serial console log implementation. This patch makes use of this interface by implementing a simple TCP socket proxy, providing access to instance serial console ports. DocImpact Implements: blueprint hyperv-serial-ports Change-Id: I58c328391a80ee8b81f66b2e09a1bfa4b26e584c
Diffstat (limited to 'nova/virt/hyperv/pathutils.py')
-rw-r--r--nova/virt/hyperv/pathutils.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/nova/virt/hyperv/pathutils.py b/nova/virt/hyperv/pathutils.py
index d97a8b7ca6..48a2038b20 100644
--- a/nova/virt/hyperv/pathutils.py
+++ b/nova/virt/hyperv/pathutils.py
@@ -127,8 +127,19 @@ class PathUtils(pathutils.PathUtils):
return self._get_instances_sub_dir(dir_name, create_dir=True,
remove_dir=True)
- def get_vm_console_log_paths(self, vm_name, remote_server=None):
- instance_dir = self.get_instance_dir(vm_name,
+ def get_vm_console_log_paths(self, instance_name, remote_server=None):
+ instance_dir = self.get_instance_dir(instance_name,
remote_server)
console_log_path = os.path.join(instance_dir, 'console.log')
return console_log_path, console_log_path + '.1'
+
+ def copy_vm_console_logs(self, instance_name, dest_host):
+ local_log_paths = self.get_vm_console_log_paths(
+ instance_name)
+ remote_log_paths = self.get_vm_console_log_paths(
+ instance_name, remote_server=dest_host)
+
+ for local_log_path, remote_log_path in zip(local_log_paths,
+ remote_log_paths):
+ if self.exists(local_log_path):
+ self.copy(local_log_path, remote_log_path)