Difference between revisions of "Example-simple"

From VNUML-WIKI
Jump to: navigation, search
(Scenario)
(VNUML Description)
Line 34: Line 34:
 
<pre>
 
<pre>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vnuml SYSTEM "/usr/local/share/xml/vnuml/vnuml.dtd">
+
<!DOCTYPE vnuml SYSTEM "/usr/local/share/xml/vnuml/vnuml.dtd"
 +
[
 +
  <!ENTITY VNUMLDIR "/usr/local/share/vnuml/">
 +
]>
 +
 
  
 
<!--
 
<!--
Line 40: Line 44:
 
Just one virtual machine. Use this specification for testing
 
Just one virtual machine. Use this specification for testing
  
NOTE: if you are experiencing problems with the conventional xterm, we  
+
NOTE: if you are experiencing problems with the conventional xterm, we
recommend you to uncomment the <xterm> tag, in order to use gnome-terminal,  
+
recommend you to uncomment the <xterm> tag, in order to use gnome-terminal,
that seems to be more stable. Of course, you will need the gnome-terminal  
+
that seems to be more stable. Of course, you will need the gnome-terminal
 
installed in your system.
 
installed in your system.
 
-->
 
-->
Line 54: Line 58:
 
     <vm_mgmt type="none" />
 
     <vm_mgmt type="none" />
 
     <vm_defaults>
 
     <vm_defaults>
       <filesystem type="cow">/usr/local/share/vnuml/filesystems/root_fs_tutorial</filesystem>
+
       <filesystem type="cow">&VNUMLDIR;filesystems/root_fs_tutorial</filesystem>
       <kernel>/usr/local/share/vnuml/kernels/linux</kernel>
+
       <kernel>&VNUMLDIR;kernels/linux</kernel>
 
       <console id="0">xterm</console>
 
       <console id="0">xterm</console>
 
       <!--xterm>gnome-terminal,-t,-x</xterm-->
 
       <!--xterm>gnome-terminal,-t,-x</xterm-->

Revision as of 22:39, 10 March 2007

VNUML Simple Example

Authors:
David Fernández (david at dit.upm.es)
version 1.7, February 15th, 2007


Scenario

This is the most simple example you can build using VNUML. It just starts one virtual machine named "host1" without any virtual network. It can be used to test and tune the kernel and root filesystem you plan to use in a simulation.

It is always recomended to first test kernel and filesystems in your machine using a simple scenario like this before using them in more complex scenarios. That will save you a lot of time, allowing to detect and correct typical problems related to the virtual machines boot process.

Once the simulation is started, you can access the virtual machine using several methods (see the <vm_mgmt> tag):

  • Using the xterm console started by default (see line "<con0>xterm</con0>" in VNUML spec). In this case, the simulation has to be started from an X terminal. NOTE: if you are experiencing problems with the conventional xterm, we recommend you to uncomment the <xterm> tag in each virtual machine, in order to use gnome-terminal, that seems to be more stable. Of course, you will need the gnome-terminal installed in your system.
  • Through a pseudo tty (pts) using "screen" application (or any other terminal emulation application). In this case you have to:
    • change "xterm" by "pts"
    • start the simulation using: "vnuml -t simple.xml -e screen.cfg"
    • access the console using: "screen -c screen.cfg"
  • Through the management interface using SSH. For example: "slogin 192.168.0.2" (if you add the <host_mapping> tag to global section you can use the virtual machine name: "slogin host1").

The first and second methods are recomended, because they allow you to see all log messages showed by the virtual machine when starting, as well as to access it even if the management interface has not been started correctly.

VNUML Description


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vnuml SYSTEM "/usr/local/share/xml/vnuml/vnuml.dtd"
[
  <!ENTITY VNUMLDIR "/usr/local/share/vnuml/">
]>


<!--
Simple simulation
Just one virtual machine. Use this specification for testing

NOTE: if you are experiencing problems with the conventional xterm, we
recommend you to uncomment the <xterm> tag, in order to use gnome-terminal,
that seems to be more stable. Of course, you will need the gnome-terminal
installed in your system.
-->

<vnuml>

  <global>
    <version>1.7</version>
    <simulation_name>simple</simulation_name>
    <automac/>
    <vm_mgmt type="none" />
    <vm_defaults>
       <filesystem type="cow">&VNUMLDIR;filesystems/root_fs_tutorial</filesystem>
       <kernel>&VNUMLDIR;kernels/linux</kernel>
       <console id="0">xterm</console>
       <!--xterm>gnome-terminal,-t,-x</xterm-->
    </vm_defaults>
  </global>

  <!-- NODES -->
  <vm name="host1" />

</vnuml>

Download

Old Releases