Difference between revisions of "Example-simple"

From VNUML-WIKI
Jump to: navigation, search
(VNUML Description)
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Title|VNUML Simple Example}}
 
{{Title|VNUML Simple Example}}
  
==<br /> version 1.6.0=====Author:<br /> David Fernández ([mailto:david at dit.upm.es david at dit.upm.es])=======January 15th, 2006====<br /><br />
+
<big>
| style="text-align: right; vertical-align: top" width="208" |
+
Authors:
[http://www.dit.upm.es/vnuml [[Image:vnuml.png|Virtual Network User Mode Linux]]]
+
'''David Fern&aacute;ndez (david at dit.upm.es)'''
|-
+
'''version 1.8, October 3rd, 2007'''
| class="title" colspan="2" | Scenario
+
</big>
|-
+
 
| colspan="2" |
+
__TOC__
<br />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. The example has been updated from 1.3 to 1.6 thanks to Esteban Martín.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 [../../1.6/reference/index.html#vm_mgmt <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. <font color="red">'''NOTE:'''</font> if you are experiencing problems with the conventional xterm, we recommend you to uncomment the [../../1.6/reference/index.html#xterm <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.
+
 
 +
== 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 [[Reference#<vm_mgmt>|<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. <font color="red">'''NOTE:'''</font> if you are experiencing problems with the conventional xterm, we recommend you to uncomment the [[Reference#<xterm>|<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:
 
* Through a pseudo tty (pts) using "screen" application (or any other terminal emulation application). In this case you have to:
 
** change "xterm" by "pts"
 
** change "xterm" by "pts"
 
** start the simulation using: "vnuml -t simple.xml -e screen.cfg"
 
** start the simulation using: "vnuml -t simple.xml -e screen.cfg"
 
** access the console using: "screen -c 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 [../../1.6/reference/index.html#host_mapping <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.You can download the simulation file from [simple.xml here]. <br /><br />
 
|-
 
| class="title" colspan="2" | VNUML Description
 
|-
 
| colspan="2" |
 
<br />
 
<?xml version="1.0" encoding="UTF-8"?>
 
<!DOCTYPE vnuml SYSTEM "/usr/local/share/xml/vnuml/vnuml.dtd">
 
<vnuml>
 
 
  <global>
 
    <version>1.6</version>
 
    <simulation_name>simple</simulation_name>
 
    <ssh_key>/root/.ssh/identity.pub</ssh_key>
 
    <automac offset="0"/>
 
    <vm_mgmt type="none" offset="0" />
 
    <shell>/bin/sh</shell>
 
  </global>
 
 
  <!-- NODES -->
 
  <vm name="host1">
 
    <filesystem type="cow">/usr/local/share/vnuml/filesystems/root_fs_tutorial</filesystem>
 
    <kernel>/usr/local/share/vnuml/kernels/linux</kernel>
 
    <boot>
 
        <con0>xterm</con0>
 
        <!--xterm>gnome-terminal,-t,-x</xterm-->
 
    </boot>
 
  </vm>
 
</vnuml>
 
<br />
 
|-
 
| class="title" colspan="2" | Old Releases
 
|-
 
| colspan="2" |
 
<br />
 
* [1.3/simple.html 1.3]<br />
 
|-
 
| colspan="2" |
 
----
 
<center><font face="Tahoma">''Last update: <br />''</font><br /><center>[http://validator.w3.org/check/referer [[Image:valid-html401.png|Valid HTML 4.01!]]]</center></center>
 
|}
 
  
</div>
+
* Through the management interface using SSH. For example: "slogin 192.168.0.2" (if you add the [[Reference#<host_mapping>|<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 ==
 +
 
 +
<br/>
 +
 
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd"
 +
[
 +
  <!ENTITY VNUMLDIR "/usr/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.8</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="1">xterm</console>
 +
      <!--xterm>gnome-terminal,-t,-x</xterm-->
 +
    </vm_defaults>
 +
  </global>
 +
 
 +
  <!-- NODES -->
 +
  <vm name="host1"/>
 +
 
 +
</vnuml>
 +
</pre>
 +
 
 +
== Download ==
 +
 
 +
* VNUML specification file: [http://jungla.dit.upm.es/~vnuml/doc/examples/simple/simple.xml Simple.xml]
 +
 
 +
== Old Releases ==
 +
 
 +
* [http://jungla.dit.upm.es/~vnuml/doc/examples/simple/1.3/simple.html 1.3]
 +
* [http://jungla.dit.upm.es/~vnuml/doc/examples/simple/1.6/simple.html 1.6]
 +
* [[Example-simple-1.7|1.7]]

Latest revision as of 11:31, 4 October 2007

VNUML Simple Example

Authors:
David Fernández (david at dit.upm.es)
version 1.8, October 3rd, 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/share/xml/vnuml/vnuml.dtd" 
[
  <!ENTITY VNUMLDIR "/usr/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.8</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="1">xterm</console>
       <!--xterm>gnome-terminal,-t,-x</xterm-->
    </vm_defaults>
  </global>

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

</vnuml>

Download

Old Releases