Test that tries to create a 16MB domain
PATCH 1/1 Test that tries to create a 16MB domain
This patch adds a test that tries to create a domain with only 16MB of RAM. It verifies that the domain is created and that the console works.
Right now this test fails for me: the domain just dies immediately with no indication of why, or with any useful console data. Should we put a sanity check on xm's create and mem-set commands that prevent the user from doing something we know won't work? Perhaps we can add a --force flag to allow overrides.
Thoughts?
# HG changeset patch
# User [email protected]
# Node ID bb952a9c3aaa8ff13677cc8d98e131d9992eac1c # Parent c2c033d42ffcc7061a505e0e62e9fbe0ff9ae152 Test for creating a domain with too little memory.
tools/xm-test/tests/create/Makefile.am +2 -2
@@ -12,8 +12,8 @@ 11_create_concurrent_pos.test \ 12_create_concurrent_stress_pos.test \ 13_create_multinic_pos.test \ - 14_create_blockroot_pos.test - + 14_create_blockroot_pos.test \ + 15_create_smallmem_pos.test DISABLED_TESTS = 05_create_noroot_noram_neg.test
tools/xm-test/tests/create/15_create_smallmem_pos.py new file +27 -0
@@ -0,0 +1,27 @@ +#!/usr/bin/python + +# Copyright (C) International Business Machines Corp., 2005 +# Author: Dan Smith <[email protected]> + +from XmTestLib import * + +MEM = 16 + +domain = XmTestDomain(extraOpts={"memory":"%i" % MEM}) + +try: + domain.start() +except DomainError, e: + FAIL("Unable to start a domain with %i MB" % MEM) + +try: + console = XmConsole(domain.getName()) + console.sendInput("input") + console.runCmd("ls") +except ConsoleError, e: + if e.reason == RUNAWAY: + FAIL("Bug #380: Starting a console with %i MB crashed the console daemon" % MEM) + else: + FAIL("Starting a console with %i MB failed: domain dies immediately!" % MEM) + +domain.destroy()
Signature · 4 lines
Dan Smith IBM Linux Technology Center Open Hypervisor Team email: [email protected]
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Ewan Mellor
AppliedQuoted 9 lines · Dan Smith
This patch adds a test that tries to create a domain with only 16MB of RAM. It verifies that the domain is created and that the console works.
Right now this test fails for me: the domain just dies immediately with no indication of why, or with any useful console data. Should we put a sanity check on xm's create and mem-set commands that prevent the user from doing something we know won't work? Perhaps we can add a --force flag to allow overrides.
I've applied the patch, thanks.
Regarding the failure, perhaps a check or a warning would be a good idea, but I'm wary of blocking out at certain memory limits. If someone wrote a tiny OS (say the OS equivalent of Hello World) then surely it would work in less than 16MB, so why should we put such a limit?
Ewan.
EM> Regarding the failure, perhaps a check or a warning would be a EM> good idea, but I'm wary of blocking out at certain memory limits. EM> If someone wrote a tiny OS (say the OS equivalent of Hello World) EM> then surely it would work in less than 16MB, so why should we put EM> such a limit?
I completely agree with you. The --force flag would be one way around this. We could also add it to the xend configuration as an adjustable limit. Another option might be to have the limit determined by the builder that is used, right?
switch (type) {
case linux: limit = 24;
case fatos: limit = 128;
default: limit = 0;
}Something like that? I'm not sure off hand if this info is available after build time for protecting mem-set, but we could make the limit a property of the domain to solve that easily.
Signature · 4 lines
Dan Smith IBM Linux Technology Center Open Hypervisor Team email: [email protected]
Quoted 9 lines · Dan Smith
This patch adds a test that tries to create a domain with only 16MB of RAM. It verifies that the domain is created and that the console works.
Right now this test fails for me: the domain just dies immediately with no indication of why, or with any useful console data. Should we put a sanity check on xm's create and mem-set commands that prevent the user from doing something we know won't work? Perhaps we can add a --force flag to allow overrides.
I routinely create 4M domains (and I would be able to create them even smaller if the domain builder would allow it), there is event a recent Xen paper that mentions running ttylinux in this amout of space.
I think this is a problem in XenLinux, it was discussed recently, and that you can 'fix' it by setting mem=16M on the linux command line.
Jacob
--
Save time and bandwidth with EDelta: http://www.diku.dk/~jacobg/edelta/
JH> I routinely create 4M domains (and I would be able to create them JH> even smaller if the domain builder would allow it), there is event JH> a recent Xen paper that mentions running ttylinux in this amout of JH> space.
But not with a 4M ramdisk, I'm guessing, which is what xm-test uses :)
JH> I think this is a problem in XenLinux, it was discussed recently, JH> and that you can 'fix' it by setting mem=16M on the linux command JH> line.
This may be true, however, I am unable to start a 16MB domain with extra="mem=16M" on x86_64 (x86_32 works). The domain hangs when trying to unpack the ramdisk. I'll submit a patch that adds the mem=16M argument to the kernel command line so that it will pass on 32 bit.
If there's something different about x86_64 that limits the minimum size of a domain, then I re-argue for some sort of arch-specific soft limit to "help" the user realize that they are doing something that is likely to fail.
Signature · 4 lines
Dan Smith IBM Linux Technology Center Open Hypervisor Team email: [email protected]