Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
VirtaMove Knowledge Center
/
Creating a Config-on-the-Fly File
Updated Sept 23, 2022

    Creating a Config-on-the-Fly File

    Table of Contents

    • 1 Creating a Config-on-the-Fly File
    • 2 Config-on-the-fly Nodes
      • 2.1 TARGET Node
      • 2.2 EXCLUDE Node
      • 2.3 ACTION Node

    Creating a Config-on-the-Fly File

    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:

    CPROP_CONFIG_FILE

    You can:

    • 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 COTF folder:

    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:

    ".\COTF\StandardCOTF.xml"

    or the absolute full path:

    "C:\appliance\ContainerName\COTF\StandardCOTF.xml"

    You can also specify only the file name of the COTF file if the file is in the COTF folder. For example:

    "StandardCOTF.xml"

    If a container requires a custom Config-on-the-fly file, copy the file into the COTF folder of the container before you compress and move the container. You can then manually update the CPROP_CONFIG_FILE after you uncompress the container to make sure that it is set to the current location of the custom Config-on-the-fly file.

    Config-on-the-fly Nodes

    The Config-on-the-fly file defines one or more TARGET nodes:

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

    • EXCLUDE node - defines 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)

    TARGET Node

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

    • folder

    • include_subfolders

    • entries

    The include_subfolders attribute is optional. If it is omitted, its value is the default value "no". If include_subfolders is set to "no" or not specified, then folder and entries specify the file(s) entries under file directory folder, or the registry key value(s) entries under key folder. If include_subfolders is set to "yes", then folder and entries specify file(s) entries under directory folder and folder's subdirectories, or registry key value(s) entries under key folder and folder's subkeys.

    TARGET Example 1

    <TARGET folder="%SystemDrive%\Program Files (x86)\Apache Software Foundation\Apache2.2\conf" entries="httpd.conf">

    Specifies the file: "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\httpd.conf" (if C:\ drive is the system or home drive.)

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

    TARGET Example 2

    <TARGET folder="HKLM\SOFTWARE\my_company\my_app" entries="*">

    Specifies all the registry key values under the key "HKLM\SOFTWARE\my_company\my_app".

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

    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:

    <EXCLUDE>    <PATH>%SystemDrive%\Documents 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:

    <ACTION type="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 each 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 nodes follow the "POSIX-Extended Regular Expressions" rules.

    Example replace:

    <TARGET folder="*" include_subfolders="yes" entries="*">    <EXCLUDE>       <PATH>%SystemRoot%\system32\inetsrv\config\*</PATH>       <!-- <PATH>*.h</PATH> -->       <!-- <PATH>*.sql</PATH> -->       <!-- <PATH>*.log</PATH> -->    </EXCLUDE>    <ACTION type="replace">       <SEARCH>$cotf0</SEARCH>       <REPLACE>%COMPUTERNAME%</REPLACE>     </ACTION>    <ACTION type="replace">       <SEARCH>CPROP_SRC_NODENAME</SEARCH>       <REPLACE>%COMPUTERNAME%</REPLACE>     </ACTION>    <ACTION type="replace">       <SEARCH>CPROP_SRC_NETBIOSNAME</SEARCH>       <REPLACE>%COMPUTERNAME%</REPLACE>     </ACTION>    <ACTION type="replace">        <SEARCH>CPROP_SRC_IPADDR</SEARCH>        <REPLACE>CPROP_IPADDR</REPLACE>     </ACTION>   </TARGET> </VirtaMove>

    Example execute:

    <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>

     


    VirtaMove Documentation
    • VirtaMove Support Knowledge Base
      VirtaMove Support Knowledge Base
       This trigger is hidden
    Results will update as you type.
    • V-Migrate Documentation
      • 01. Managing Your VirtaMove Licensing
      • 02. Installation Guide
      • 03. Application Migration Guide
        • Environmental and Machine Requirements for Migration
        • Introduction to VirtaMove Application Migration
        • Activating Your VirtaMove License
        • Migrating an Application
        • Migrating an IIS Application
        • Using VirtaMove Source Monitor
        • Monitoring Migration
        • Running and Exercising Your Application
        • Dissolving Your Application
        • Advanced Application Migration
          • Config-on-the-Fly
          • Global COTF Utility
          • Creating a Config-on-the-Fly File
          • Considerations When Compressing and Moving a Container
      • 04. Administration Guide
      • 05. CLI Guide
      • About VirtaMove V-Migrate Documentation
    • V-Maestro Documentation
    • VirtaLinux Documentation

      You‘re viewing this with anonymous access, so some content might be blocked.
      {"serverDuration": 11, "requestCorrelationId": "ed534ac371084ac2b93643261aa5257e"}