Difference between revisions of "Vnx-autoconf"

From VNX
Jump to: navigation, search
(Copying files: tag    )
(Copying files: tag    )
Line 30: Line 30:
 
<ul>
 
<ul>
 
<li>Copy all the files and directories under host directory conf/R1/1 (relative path to the directory where the XML file resides) to /etc/quagga directory of VM:</li>  
 
<li>Copy all the files and directories under host directory conf/R1/1 (relative path to the directory where the XML file resides) to /etc/quagga directory of VM:</li>  
  <filetree seq='copy1' root='/etc/quagga>conf/R1/1/</filetree>'
+
  <filetree seq='copy1' root='/etc/quagga'>conf/R1/1/</filetree>
 
<li>Copy the host file conf/H2/test-page.html to /var/www/html directory, change its name to index.html, change its owner:group to www-data:www-data and change its permissions to 644</li>
 
<li>Copy the host file conf/H2/test-page.html to /var/www/html directory, change its name to index.html, change its owner:group to www-data:www-data and change its permissions to 644</li>
  <filetree seq='copy2' root='/var/www/html/index.html>conf/H2/test-page.html user="www-data" group="www-data" perms="644"</filetree>'
+
  <filetree seq='copy2' root='/var/www/html/index.html'>conf/H2/test-page.html user='www-data' group='www-data' perms='644'</filetree>'
 
</ul>
 
</ul>
  

Revision as of 00:12, 27 August 2015

Autoconfiguration and Command Execution (ACE)

Command execution

Users can directly interact with virtual machines through their consoles or management interfaces. However, in order to automate the execution of commands in virtual machines, VNX provides three tags for that purpose:

  • <filetree>, to copy of files from the host to the virtual machines,
  • <exec>, to execute commands inside virtual machines, and
  • <cmd-seq>, to create composed command sequences.

All of them have an attribute named "seq" that allows to associate a string identifier to them. This identifier is used to invoke the execution of that commands from the VNX command line. For example:

vnx -f tutorial_lxc_ubuntu.xml --execute start-www

will execute all the commands defined in 'tutorial_lxc_ubuntu.xml' with the attribute seq='start-www'. The parameter passed to '--execute' option can be a comma-separated list of seq identifiers to allow executing several set of commands. For example:

vnx -f tutorial_lxc_ubuntu.xml --execute stop-www,start-www

will execute in sequentially the set of commands identified by 'stop-www' and 'start-www'.

Copying files: <filetree> tag    

<filetree> tag is used to copy files from the host to a virtual machine. The value inside the tag specifies the file or directory to be copied to the virtual machine.

The destination directory or filename inside the virtual machine where the file(s) will be copied is specified using the 'root' attribute.

By convention, directory names have to be terminated with an '/' to distinguis them from filenames.

The attributes user, group and perms can be used to specify respectively the owner, group and permisions of the files copied. Permissions have to be specified using linux numerical style (i.e. '644').

Examples:

  • Copy all the files and directories under host directory conf/R1/1 (relative path to the directory where the XML file resides) to /etc/quagga directory of VM:
  • <filetree seq='copy1' root='/etc/quagga'>conf/R1/1/</filetree>
    
  • Copy the host file conf/H2/test-page.html to /var/www/html directory, change its name to index.html, change its owner:group to www-data:www-data and change its permissions to 644
  • <filetree seq='copy2' root='/var/www/html/index.html'>conf/H2/test-page.html user='www-data' group='www-data' perms='644'</filetree>'
    

Executing commands: <exec> tag

Creating composed command sequences: <cmd-seq> tag

The "ostype" attribute is used to specify the type of command included in <exec> tag, either command line (CLI) or graphical (GUI), and whether vnx tool waits for command execution end or not. For values are posible:

ostype Type of commands Waits for command execution end
system CLI YES
exec CLI NO
xsystem GUI YES
xexec GUI NO

Autoconfiguration

To be completed....