Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can use a Config-on-the-fly file to define how specific file/registry items being tethered to on the source machine will be configured on the destination machine. For example, you may need to replace source machine identification information (hostname, IP address, etc.) with the destination machine ID information. You can use the Config-on-the-fly file to accomplish this task.

You can specify the Config-on-the-fly file in the Admin Console by clicking the COTF button or using the following property with virtapedit command:

Code Block
CPROP_CONFIG_FILE

...

  • specify the paths to be configured and the actions to be taken for the particular path

  • use container properties (for example, CPROP_SRC_NODENAME) as arguments when setting the CPROP_CONFIG_FILE property (for example, virtapedit <path_to_appliance> CPROP_CONFIG_FILE "StandardCOTF.xml CPROP_SRC_NODENAME")

  • use wildcards in the TARGET tag and the EXCLUDE tag of the COTF file to exclude specific files from rehosting

When you create a container, a Config-on-the-fly file is automatically created in the container's scripts COTF folder:

Code Block
scripts/COTF\StandardCOTF.xml

When you specify a path to be configured, VirtaMove supports paths that are relative to the container folder. That is, VirtaMove supports:

...

  • TARGET node - each TARGET node specifies the path(s) to be configuredACTION

  • EXCLUDE node - defines one or more ACTION nodes to specify the actions paths that you want to exclude from the TARGET node actions

  • ACTION node - specifies the action to be taken on the files found under TARGET path(s)EXCLUDE node - defines paths that you want to exclude from the

TARGET

...

TARGET Node

The TARGET node uses three attributes to define the path or paths that are to be configured:

...

The entries attribute supports wildcard names, for example: "sql???.cfg", "HostInfo*", etc. The entries attribute must not be empty.

ACTION Node

You can add actions and command-line arguments to a container template file and Config-on the-fly file. An action can be, for example, running an application or opening a link.

...

EXCLUDE Node

The EXCLUDE node defines paths that you want to exclude from the TARGET node actions. You can use wildcards in this node.

The EXCLUDE XML tags are as follows:

Code Block
<EXCLUDE>
   <PATH>%SystemDrive%\Documents  <ACTION>
    <!--and Settings\*</PATH>
   <PATH>%SystemDrive%\Users\*</PATH>
   <PATH>*\SYSTEM\CurrentControlSet\Services\*</PATH>
</EXCLUDE>

Note that Homedrive, SystemDrive, or any other system variable, is resolved relative to the destination machine and not the source machine.

ACTION Node

Each TARGET node can have multiple ACTION nodes. There are three types of ACTION nodes:

Code Block
<ACTION type="replace">-->
    <!--<PATH> </PATH>-->
    <!--<ARGUMENTS> </ARGUMENTS>-->
    <!--</ACTION>-->
  </ACTION>
</VirtaMove>

The actions can be:

...

replace

...


	<SEARCH case_sensitive="yes">old_data</SEARCH>
	<REPLACE>new_data</REPLACE>
</ACTION>

<ACTION type="execute">
	<PATH>C:\Program Files (x86)\Notepad++\notepad++.exe</PATH>
	<ARGUMENTS>%%TARGET%%</ARGUMENTS>
</ACTION>

<ACTION type="alert">
    <PATTERN>*.sys</PATTERN>
    <MESSAGE>.sys kernel file found in vaa</MESSAGE>
</ACTION>

For replace, the action searches and replaces tokens (as defined in the SEARCH and REPLACE nodes).

The execute type executes the executable defined in PATH with the arguments defined in ARGUMENTS for the entries matchedeach entry matched in this TARGET node. %%TARGET%% placeholder can be used in ARGUMENTS. It will be replaced with a matched entry/file.

The alert action presents a notification whenever a file matching the PATTERN is found inside an appliance.

COTF search and replace follows SEARCH and REPLACE nodes follow the "POSIX-Extended Regular Expressions" rules.

...

Code Block
<TARGET folder="C:\program files" include_subfolders="yes" entries="*.mof" >
    <ACTION type="execute">
      <PATH>c:\windows\System32\wbem\mofcomp.exe</PATH>
      <ARGUMENTS>%%TARGET%%</ARGUMENTS>
    </ACTION>
  </TARGET>
  <TARGET folder="C:\program files (x86)" include_subfolders="yes" entries="*.mof" >
    <ACTION type="execute">
      <PATH>c:\windows\System32\wbem\mofcomp.exe</PATH>
      <ARGUMENTS>%%TARGET%%</ARGUMENTS>
    </ACTION>
  </TARGET>

EXCLUDE Node

The EXCLUDE node defines paths that you want to exclude from the TARGET node actions. You can use wildcards in this node.

The EXCLUDE XML tags are as follows:

Code Block
<EXCLUDE>
   <PATH>%SystemDrive%\Documents and Settings\*</PATH>
   <PATH>%SystemDrive%\Users\*</PATH>
   <PATH>*\SYSTEM\CurrentControlSet\Services\*</PATH>
</EXCLUDE>

...