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

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

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

# Managing created variables

To manage variables, enter **Scripts → Script variables**.
To change a variable's parameters, press on its name or go to the

menu → **Edit**.
You can enable/disable the use of the variable. Enter the

menu → \*\*Enable (Disable) \*\*or use

switch.
To delete a variable, enter the

menu → **Delete**.
