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 ScriptsScript 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:
    .1Press Add variable.
    .2Enter the variable Name. For example, MY_PARAMETER.
    .3Enter the Value of the variable.
    .4To 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.
    .5Select the variable Scope — visibility range.
    .6Specify a discretionary Note.
    .7Press 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.