title: Variables for Scripts created at: Sat Jul 20 2024 16:56:19 GMT+0000 (Coordinated Universal Time) updated at: Mon Feb 10 2025 16:44:57 GMT+0000 (Coordinated Universal Time) --- # Variables for Scripts VMmanager allows you to insert the value of an external parameter into the script for virtual machines (VMs). You can use the built-in VMmanager variables or create your own. A variable can have a local or global visibility range. Variables with a global visibility range are available to all platform users, with a local visibility range — only to the user who created the variable. The VMmanager administrator can create a variable with any visibility range, while the user and advanced user can only create a variable with local visibility range. VMmanager built-in variables are available to all users. External variables are specified in the script in the format ($NAME), where NAME is the variable name. For example, you can use the command \*\*echo ($IP) >> /tmp/ip.txt\*\* to write the VM IP address to a file. # VMmanager built-in variables ![media\_Variables%20for%20Scripts/p6FLInltWgH658-link-solid.svg](media_Variables%20for%20Scripts/p6FLInltWgH658-link-solid.svg) VMmanager built-in variables have dynamic values. The values depend on the settings of the particular VM on which the script is executed. Built-in variables are not available for editing or deleting. To see their list, enter **Scripts** → **Script variables**. The following variables are available in the current version: | Name | Value | | ----------- | ---------------------------------- | | EMAIL | VMmanager user email | | GATEWAY | default gateway | | GATEWAYv4 | default gateway for IPv4 | | GATEWAYv6 | default gateway for IPv6 | | HOSTNAME | host name | | IP | main IP address | | IPv4 | IPv4 address | | IPv4ALIASES | additional IPv4 addresses | | IPv6 | IPv6 address | | IPv6ALIASES | additional IPv6 addresses | | MGR\_NAME | short name of VMmanager platform | | MGR\_VERSION | VMmanager platform version | | NAMESERVER | main DNS server | | NETMASK | netmask of the main IP address | | NETMASKv4 | netmask for IPv4 | | NETMASKv6 | netmask for IPv6 | | PASS | root user password | | PASS\_CRYPT | MD5 hash of the root user password | | SSHPUBKEYS | list of public SSH keys | | VOL\_SIZE\_M | main disk size | # Creating your own variables ![media\_Variables%20for%20Scripts/rVtyvEb56g4aDd-link-solid.svg](media_Variables%20for%20Scripts/rVtyvEb56g4aDd-link-solid.svg) To create a variable, enter **Scripts → Script variables**: 1. Press **Add variable**. 2. Enter the variable **Name**. For example, MY\_PARAMETER. 3. Enter the **Value** of the variable. 4. To prevent the variable value from being displayed in the platform interface, enable the **Hide variable value** option. !! Note !! When you change a variable, its value will be visible in the edit form. 1. Select the variable \*\*Scope \*\*— visibility range. 2. Specify a discretionary **Note**. 3. Press **Add**. ![Example of adding a variable ](media_Variables%20for%20Scripts/OepMBYWhbKSQ3h-example-of-adding-a-variable.png) # Managing created variables ![media\_Variables%20for%20Scripts/n5u1oobNUKgRjV-link-solid.svg](media_Variables%20for%20Scripts/n5u1oobNUKgRjV-link-solid.svg) To manage variables, enter **Scripts → Script variables**. To change a variable's parameters, press on its name or go to the ![media\_Variables%20for%20Scripts/vEbz-rPOyUvRpK-image2021-5-4\_13-35-4.png](media_Variables%20for%20Scripts/vEbz-rPOyUvRpK-image2021-5-4_13-35-4.png) menu → **Edit**. You can enable/disable the use of the variable. Enter the ![media\_Variables%20for%20Scripts/lE7vDRP\_DUSSZ8-image2021-5-4\_13-35-4.png](media_Variables%20for%20Scripts/lE7vDRP_DUSSZ8-image2021-5-4_13-35-4.png) menu → \*\*Enable (Disable) \*\*or use ![media\_Variables%20for%20Scripts/vA4lZqg7BFN5Xe-image2021-5-27\_12-7-46.png](media_Variables%20for%20Scripts/vA4lZqg7BFN5Xe-image2021-5-27_12-7-46.png) switch. To delete a variable, enter the ![media\_Variables%20for%20Scripts/080iIMsqu8UZ8F-image2021-5-4\_13-35-4.png](media_Variables%20for%20Scripts/080iIMsqu8UZ8F-image2021-5-4_13-35-4.png) menu → **Delete**. ![Interface of the "Script variables" section ](media_Variables%20for%20Scripts/POHi3Pf41jPcOb-interface-of-the-script%20variables-section.png)