I''m trying to mount two filesystems in a Xen virtual machine. I think this should work since ''xm'' has an option to attach virtual disks. Can''t get it to work though. Here''s my domU config file: ################ kernel = "/boot/kernel-domU" memory = 128 name = "dom1" nics = 1 disk = [''phy:/dev/evms/domubase,xvda1,r''] disk = [''file:/images/linux1.img,xvda2,w''] root = "/dev/xvda1 ro" ################ Using the above, the domU kernel dies like this: ==========VFS: Cannot open root device "xvda1" or unknown-block(0,0) Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ========== If I switch the order of the two ''disk'' lines, the domU actually boots, but xvda2 is inacessible and nowhere to be found. Am I doing something wrong? _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Christopher G. Stach II
2006-Jan-09 17:13 UTC
Re: [Xen-users] multiple disk images, how to?
Molle Bestefich wrote:> I''m trying to mount two filesystems in a Xen virtual machine. > I think this should work since ''xm'' has an option to attach virtual disks. > Can''t get it to work though. > > Here''s my domU config file: > ################ > kernel = "/boot/kernel-domU" > memory = 128 > name = "dom1" > nics = 1 > disk = [''phy:/dev/evms/domubase,xvda1,r''] > disk = [''file:/images/linux1.img,xvda2,w''] > root = "/dev/xvda1 ro" > ################ > > Using the above, the domU kernel dies like this: > ==========> VFS: Cannot open root device "xvda1" or unknown-block(0,0) > Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) > ==========> > If I switch the order of the two ''disk'' lines, the domU actually > boots, but xvda2 is inacessible and nowhere to be found. > > Am I doing something wrong? > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-usersHave you tried this? disk = [''phy:/dev/evms/domubase,xvda1,r'', ''file:/images/linux1.img,xvda2,w''] _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Christopher G. Stach II wrote:> Have you tried this? > > disk = [''phy:/dev/evms/domubase,xvda1,r'', ''file:/images/linux1.img,xvda2,w'']Ahem. No. Duh. Thank you! :-). And sorry for the noise, I''ll try harder to RTFM next time. (Maybe there should be a syntax example in ''man xmdomain.cfg'' for really dumb people like myself.. Maybe the parser should complain when it meets two disk statements in one config file.. Humn.) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Molle Bestefich wrote:> (Maybe there should be a syntax example in ''man xmdomain.cfg'' for > really dumb people like myself.. Maybe the parser should complain > when it meets two disk statements in one config file.. Humn.)Well, it''s not actually using a custom parser -- the syntax is Python. To have the Python interpreter barf when a variable is defined multiple times would be a trick. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Charles Duffy wrote:> Molle Bestefich wrote: > > (Maybe there should be a syntax example in ''man xmdomain.cfg'' for > > really dumb people like myself.. Maybe the parser should complain > > when it meets two disk statements in one config file.. Humn.) > > Well, it''s not actually using a custom parser -- the syntax is Python. > To have the Python interpreter barf when a variable is defined multiple > times would be a trick.I don''t know Python. Is it easy to do something like this (bash code): disk_entries=`grep -E ^disk < $config_file | wc -l` if [ $disk_entries -gt 1 ]; then echo Uh-oh... fi ? If it is, I''d be willing to take a look at it :-p. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Molle Bestefich wrote:> I don''t know Python. > Is it easy to do something like this (bash code): > > disk_entries=`grep -E ^disk < $config_file | wc -l` > if [ $disk_entries -gt 1 ]; then > echo Uh-oh... > fi >Not really, no. See, the config file could look like this: if ''foo'' in locals(): disk = [''/dev/foo/bar%(foo)s'' % foo] else: disk = [''/dev/foo/baz''] ...in which case you''d have two disk entries, but only one of them would ever be executed. Or you could have some fancy dynamic code that looks at hotplugged USB devices, or who-knows-what, all inside your config file. Trying to parse the config file any way *other* than with the Python interpreter would thus be brittle when folks try to take advantage of the power of having their configuration language be a real scripting language. Think of it as if you were sourcing a file to get your config settings in bash. Someone could have logic like this: if [ -n "$foo" ] ; then DISK="/dev/foo/bar${foo}" else DISK="/dev/foo/baz" fi ...and that would be valid, so you wouldn''t want to call the config file invalid if it had more than one line matching ^[[:space:]]*DISK _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Charles Duffy wrote:> Think of it as if you were sourcing a file to get your config settings > in bash. Someone could have logic like this: > > if [ -n "$foo" ] ; then > DISK="/dev/foo/bar${foo}" > else > DISK="/dev/foo/baz" > fiEven if that''s desirable for <insert insane scenario here>...> ...and that would be valid, so you wouldn''t want to call the config file > invalid if it had more than one line matching ^[[:space:]]*DISK...you would want at least be able to throw a warning when it happens, since regular users probably expect standard config-file semantics from a config file, not Python semantics. Another approach would be to note in each configuration file that it''s Python syntax. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Molle Bestefich wrote:> ...you would want at least be able to throw a warning when it happens, > since regular users probably expect standard config-file semantics > from a config file, not Python semantics. >Extending lists by describing the same item multiple times isn''t Python semantics, and not every config-semantics-compliant parser issues complaints when redefinitions occur. You''re arguing to make things uglier for users who take advantage of advanced features for the purpose of implementing a feature which is strictly a nice-to-have to help folks realize when they''ve screwed up. Now, if there weren''t documentation to help prevent folks from screwing up, you might almost have a point -- but see below...> Another approach would be to note in each configuration file that it''s > Python syntax. >It''s already documented that it''s Python code -- xmexample2''s first line of documentation text describes it as "# Example Python setup script for ''xm create''", while xmexample1 starts with "# Python configuration setup for ''xm create''". Furthermore, the xmexample* files include examples of the Pythonic list syntax, so there''s a clear reference to use when defining multiple drives (or whatnot). xmexample.vmx *also* starts with a disclaimer that it''s Python code -- so yes, each and every example configuration file given does indeed already note that it''s Python syntax. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Charles Duffy wrote:> Molle Bestefich wrote: > > ...you would want at least be able to throw a warning when it happens, > > since regular users probably expect standard config-file semantics > > from a config file, not Python semantics. > > Extending lists by describing the same item multiple times isn''t Python > semantics,I know. I never argued that it was. You must''ve misunderstood me..> and not every config-semantics-compliant parser issues > complaints when redefinitions occur.My point exactly, a whole lot of them actually uses redefinitions for something purposeful.> You''re arguing to make things uglier for users who take > advantage of advanced featuresMmh. Yes.> for the purpose of implementing a feature which is strictly a > nice-to-have to help folks realize when they''ve screwed up.Wrong - to inform regular users that the config file is not in the syntax that they (anyone) would expect.> Now, if there weren''t documentation to help prevent folks from screwing up, > you might almost have a point --Ah, "almost", now you''re just poking me in the eye for the fun of it. Don''t do that...> It''s already documented that it''s Python codeAh, if it''s documented, fair enough then. But alas...> -- xmexample2''s first line of documentation text describes it as > "# Example Python setup script for ''xm create''","Python setup script" in no way implies that the script is a "Python script". "Python script used to setup domains by ''xm create''" would have, but that''s not what it says.> while xmexample1 starts with "# Python configuration setup for ''xm create''".Again, the above in no way implies that the file itself is a Python script.> Furthermore, the xmexample* files include examples of > the Pythonic list syntax, so there''s a clear reference to use when > defining multiple drives (or whatnot).That''s not good enough. You cannot expect newbies to dig in to the most complicated features / configurations of a system just to get to know how to achieve the basics.> so yes, each and every example configuration file given does indeed > already note that it''s Python syntax.No, you''re wrong. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Molle Bestefich wrote:> "Python setup script" in no way implies that the script is a "Python script". > > "Python script used to setup domains by ''xm create''" would have, but > that''s not what it says. >Okay, that''s valid. I suppose if you submit a patch to -dev with better wording that it would likely be accepted. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
There is an alternative to the Python scripts for configuring domU''s -- just using S-expressions (SXP''s) directly. However, if this is perceived as a more "low-level" interface, I don''t know how stable it''s going to be across different releases of Xen. Running ''xm create --dryrun'' on a Python domU configuration file will spit out a corresponding S-expression (SXP), and running ''xm create --config your_sxp'' will create a domU based on an S-expression (SXP). It seems on the whole far better organized than the Python configuration files to me. It also allows for comments (which begin with ''#'' and extend to the end of the line), so it''s not as if it could not be feasible for use by first-time Xen users if it were well documented. Is anyone opposed to using S-expressions as a stable interface for domU configurations? Thanks. Andrew -- Andrew D. Ball aball@us.ibm.com "Festina Lente" $\approx$ "Make hast slowly" -- Caesar Augustus _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On 1/18/06, Andrew D. Ball <aball@us.ibm.com> wrote:> There is an alternative to the Python scripts for configuring domU''s -- > just using S-expressions (SXP''s) directly. > > However, if this is perceived as a more "low-level" interface, I don''t know > how stable it''s going to be across different releases of Xen. > > Running ''xm create --dryrun'' on a Python domU configuration file will > spit out a corresponding S-expression (SXP), and running ''xm create --config > your_sxp'' will create a domU based on an S-expression (SXP). > > It seems on the whole far better organized than the Python configuration > files to me. It also allows for comments (which begin with ''#'' and > extend to the end of the line), so it''s not as if it could not be > feasible for use by first-time Xen users if it were well documented. > > Is anyone opposed to using S-expressions as a stable interface for > domU configurations? > > Thanks. > > Andrew > > -- > Andrew D. Ball > aball@us.ibm.comAndrew, Good to know about xm create --dryrun command and its output. Yet, I did not realize big differences between the two of them, it seems to me they are roughly the same... What is the gain? -- Bye, Fernando Maior LPIC/1(31908) LinuxCounter(391325) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Andrew D. Ball wrote:> Is anyone opposed to using S-expressions as a stable interface for > domU configurations?So long as the Python interface is still available (allowing all the nifty runtime-code-evaluation goodness), using SXPs by default (and encouraging them in the documentation and such) sounds sane to me. I wouldn''t want to lose the ability to run code at domain startup, though -- times when such functionality comes in useful may be corner cases, but when they *do* come up it''s darned handy. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fernando Maior wrote:> Good to know about xm create --dryrun command and its output. > Yet, I did not realize big differences between the two of them, > it seems to me they are roughly the same...SXPs are data rather than code. They''re easier to build a minimalistic parser for and safer for 3rd-party tools to handle (and *much* easier to build a GUI editor for). Validating them to be sure values aren''t redefined (as you suggested earlier) is much more straightforward than with handling Python code -- indeed, with SXPs that''s something which could be put directly into the parser (whereas with the Python code the parser is the Python interpreter itself, which isn''t trivial to modify). _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Even more sensible would be XML. Andrew -- Andrew D. Ball aball@us.ibm.com "Festina Lente" $\approx$ "Make hast slowly" -- Caesar Augustus On Wed, 2006-01-18 at 11:24 -0600, Charles Duffy wrote:> Fernando Maior wrote: > > Good to know about xm create --dryrun command and its output. > > Yet, I did not realize big differences between the two of them, > > it seems to me they are roughly the same... > > SXPs are data rather than code. They''re easier to build a minimalistic > parser for and safer for 3rd-party tools to handle (and *much* easier to > build a GUI editor for). > > Validating them to be sure values aren''t redefined (as you suggested > earlier) is much more straightforward than with handling Python code -- > indeed, with SXPs that''s something which could be put directly into the > parser (whereas with the Python code the parser is the Python > interpreter itself, which isn''t trivial to modify). > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users