qemu: Apply stability fix
INSTALL2: Note that VM accounting data should be kept where the filesystem will not likely fill up
git-svn-id: https://svn.apache.org/repos/asf/incubator/tashi/branches/stable@1370614 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/doc/INSTALL2 b/doc/INSTALL2
index 34c437f..a53a945 100644
--- a/doc/INSTALL2
+++ b/doc/INSTALL2
@@ -12,6 +12,16 @@
You can then start the node manager manually, or have it start from the
system initialization scripts.
+---+ VM host best practices
+
+The nodemanager will use a small amount of local storage to keep
+accounting data on the virtual machines that it manages. The
+copy-on-write storage used by running virtual machines will also be
+written locally. For the sake of stability, these two storage locations
+should be chosen so that there is always sufficient space for the
+accounting data. Otherwise, this could lead to VMs running but not known
+to the nodemanager.
+
---+ Deployment over multiple networks
To add additional networks to the Apache Tashi cluster, they should be
diff --git a/src/tashi/nodemanager/vmcontrol/qemu.py b/src/tashi/nodemanager/vmcontrol/qemu.py
index 54680be..747418e 100644
--- a/src/tashi/nodemanager/vmcontrol/qemu.py
+++ b/src/tashi/nodemanager/vmcontrol/qemu.py
@@ -396,6 +396,10 @@
return child
def __saveChildInfo(self, child):
+ # XXXstroucki: if the disk INFO_DIR is on is full,
+ # we may not be able to store our data. This can lead
+ # to VMs remaining running that the NM doesn't know about
+ # Can we do anything, or should be a task external to Tashi?
info = open(self.INFO_DIR + "/%d"%(child.pid), "w")
cPickle.dump((child.instance, child.pid, child.ptyFile), info)
info.close()
@@ -730,7 +734,7 @@
def __checkPortListening(self, port):
# XXXpipe: find whether something is listening yet on the port
- p = subprocess.Popen("netstat -ln | grep 0.0.0.0:%d | wc -l" % (port), shell = True, stdin = PIPE, stdout = PIPE, close_fds = True)
+ p = subprocess.Popen("netstat -ln | grep 0.0.0.0:%d | wc -l" % (port), shell = True, stdin = subprocess.PIPE, stdout = subprocess.PIPE, close_fds = True)
(stdin, stdout) = (p.stdin, p.stdout)
stdin.close()
r = stdout.read()