Oracle® Fusion Middleware User's Guide for Oracle JRockit Virtual Edition 11g Release 1 (11.1.1.3.0) Part Number E15206-02 |
|
|
View PDF |
The -r
option enables you to view, add, change, and remove configuration settings for a virtual machine by modifying the virtual machine configuration directly.
Note:
If required, you can extract a configuration XML file corresponding to the modified virtual machine configuration by using the-r
vm.cfg get config
option.Syntax
java -jar jrockitve-imagetool.jar -r vm_cfg operation field [parameter]*
Note:
For information about the syntax conventions, see Documentation Conventions for Command-Line Syntax.Arguments
Argument | Description |
---|---|
vm_cfg | Path and name of the configuration file (vm.cfg ) of the virtual machine to be reconfigured. |
operation | The operation to be performed on the specified field:
Table A-3 shows the operations that are supported for each configurable field. |
field | The field to be reconfigured.
Table A-3 lists the values that you can specify for this argument. |
parameter | Parameters for the specified field.
The values that you should specify for this argument vary depending on the field to be reconfigured and the operation you want to perform. Note: When you run For more information, see Detailed Syntax for Operations of --reconfigure. |
Table A-3 lists the fields that you can reconfigure and the reconfiguration operations that you can perform. Most fields correspond to either an element or an attribute in the configuration XML file.
Table A-3 Fields and Operations of the -r Option
Field | Supported Operations | Affected XML Element Name (Attribute) |
---|---|---|
get, set |
||
get, remove |
None |
|
get, set |
||
get, set |
jrockitve-config (mandatory) (attribute: cpus) |
|
set |
disks (mandatory) (attribute: size) |
|
get |
||
get |
||
get |
None |
|
get |
||
get, set |
||
get, set |
||
set |
||
set |
||
get, set |
jrockitve-config (mandatory) (attribute: memory) |
|
add, remove, set |
||
get |
||
add, remove |
||
get, remove |
||
add, get, remove, set |
lookup-order (optional) (attribute: suffix) |
|
get |
lookup-order (optional) (attribute: suffix) |
|
add, get, remove, set |
server-order (optional) (attribute: ip) |
|
get |
server-order (optional) (attribute: ip) |
|
get, remove, set |
network (mandatory) (attribute: hostname) |
|
add, get, remove, set |
||
get |
||
disable, enable |
||
add, remove |
||
get |
||
get, set |
||
get, set |
Detailed Syntax for Operations of --reconfigure
Note:
For information about the syntax conventions, see Documentation Conventions for Command-Line Syntax.config
get config [destination.xml] set config source.xml
View or change the configuration of a virtual machine.
Parameter | Description |
---|---|
destination | Name of the XML file in which the extracted configuration information should be stored.
If you do not specify this parameter, the command displays the configuration details in XML format on the screen. |
source | Name of the XML file that contains the configuration settings to be defined for the virtual machine. |
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get config /work/config.xml
This command extracts the current configuration of the virtual machine and copies the configuration, in XML format, to the /work/config.xml
file on the local system.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set config /new/config.xml
This command replaces the configuration of the virtual machine with the settings defined in the /new/config.xml
file on the local system.
console-log
get console-log remove console-log
View or remove the log file of a virtual machine.
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get console-log
This command displays the contents of the virtual machine log file. The output is the same as that of the --get-log command.
java -jar jrockitve-imagetool.jar -r app/vm.cfg remove console-log
This command deletes the virtual machine log file.
console-log-path
get console-log-path set console-log-path logfile_path-and-name
View or change the directory and file in which log messages are stored. The default log file is /jrockitve/log/jrockitve.log
.
Parameter | Description |
---|---|
logfile_path-and-name | The path and name of the file to which console log messages should be written.
Do not specify a directory as the value of this parameter. |
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get console-log-path
This command displays the path and name of the virtual machine log file.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set console-log-path /jrockitve/log/myvm.log
This command sets /jrockitve/log/myvm.log
as the virtual machine log file.
cpus
get cpus
set cpus number
View or change the number of CPUs available to a virtual machine.
The number specified must be greater than zero. You can specify a maximum of eight virtual CPUs.
Note:
In the current release, Oracle recommends that you configure a single CPU, because configuring the virtual machine for multiple virtual CPUs affects performance.Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get cpus
This command displays the number of CPUs currently defined for the virtual machine.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set cpus 2
This command changes the number of CPUs defined for the virtual machine to 2.
disk-size
set disk-size index size
Set the hard disk space available to a virtual machine.
Parameter | Description |
---|---|
index | Index number of the disk for which you want to set the size
Note: Only one file-based disk is supported in the current release. |
size | Disk size.
Specify a numerical value followed by one of the following units (not case sensitive)
If you do not specify any unit, megabytes is assumed. If you leave a space between the size and the unit, enclose the number and the unit in quotes as shown in the example that follows. |
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg set disk-size 1 "200 MB"
This command defines 200 MB as the size of the disk represented by index number 1.
Note:
When you changedisk-size
, the virtual machine image is resized (shrunk or expanded) depending on the new size specified. If the image cannot be expanded to the specified size due to insufficient disk space or if the new size specified is lower than the current size of the image, the command returns error messages.disks
get disks
View the settings for the disk defined for a virtual machine.
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg get disks
The command displays the index number, ID, type, and size of each disk defined for the virtual machine, in the following format:
#1 id=root type=file 976 MB
enabled-services
get enabled-services
View the names of the installed services that are currently enabled.
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg get enabled-services
The command displays the names and descriptions of the services that are currently enabled, as shown in the following example output.
sshd (An SSH2 implementation with SCP and SFTP support)
free-disk-size
get free-disk-size id
View the free disk space on the specified disk ID.
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg get free-disk-size root
This command displays the amount of free space available on the disk with the ID root
.
installed-services
get installed-services
View the names of the services that are currently installed in a virtual machine.
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg get installed-services
The command displays the names of the services that are currently installed and a brief description of each service, as shown in the following example output.
jmxstat (JRockitVE kernel statistics MBean) sshd (An SSH2 implementation with SCP and SFTP support) sysstat (JRockitVE kernel sysstat statistics)
java-arguments
get java-arguments
set java-arguments "arguments"
View or change Java arguments.
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get java-arguments
This command displays the Java command-line arguments defined currently for the virtual machine.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set java-arguments "HelloWorld
"
This command sets HelloWorld
as the Java command-line argument for the virtual machine.
locale
get locale set locale locale [timezone] [charset]
View or change the locale for the virtual machine.
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get locale
This command displays the locale information for the virtual machine: language, time zone, and character encoding.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set locale en_US America/Denver Cp1252
This command changes the locale settings for the virtual machine to the specified values.
locale-timezone
set locale-timezone new_timezone
Set the time zone for the locale.
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg set locale-timezone America/Phoenix
This command changes the timezone of the virtual machine to the specified value.
locale-encoding
set locale-encoding new_charset
Set the encoding character set for the locale.
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg set locale-encoding iso-8859-1
This command changes the character encoding of the virtual machine to the specified value.
memory
get memory set memory size
View or change the memory available to a virtual machine.
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get memory
This command displays the memory size that is currently defined for the virtual machine.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set memory 512M
This command changes the memory size of the virtual machine to the specified value.
You can specify the size in the following units (not case sensitive):
K
or KB
: Kilobytes
M
or MB
: Megabytes
G
or GB
: Gigabytes
T
or TB
: Terabytes
If you do not specify any unit, megabytes is assumed.
mount
add mount type mount-point options... set mount index type mount-point options... remove mount index
Add, remove, or configure a mount point.
Parameter | Description |
---|---|
index | Index number of the mount point that you want view, change, remove.
You can find out the index number by using the |
type | The type of mount that you want to add or configure. The following mount types are supported:
Note: Only one native mount (the root disk of the virtual machine) is supported in the current release. |
mount-point | The directory, within the virtual image, at which the external file system should be mounted. |
options | The options depend on the mount type.
|
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg add mount nfs /home nfs.host.com /export/home uid=501 gid=502
This command adds an NFS mount point at the /home
directory within the virtual machine, pointing to the /export/home
directory on the nfs.host.com
server, with 501
as the user ID and 502
as the group ID.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set mount 2 nfs /home nfs.newhost.com /export/home uid=501 gid=502
This command changes the settings of the NFS mount point represented by index number 2, to the specified values.
java -jar jrockitve-imagetool.jar -r app/vm.cfg remove mount 2
This command removes the NFS mount point represented by index number 2.
mounts
get mounts
View mount points.
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg get mounts
The command displays the index number, mount type, and other parameters of all the mount points currently defined for the virtual machine, as shown in the following example output.
#1 native / #2 nfs /log logs.mycompany.com /logger/logs,uid=513,gid=502
The first line in the example output shows details of the native mount pointing to the root (/
) directory of the virtual machine file system. The second line shows the directory /logger/logs
on the logs.mycompany.com
server mounted as an NFS mount point at the /log
directory in the file system of the virtual machine.
network-dns-host
add network-dns-host ip-address host remove network-dns-host ip-address host
Add or remove a static host entry in the DNS hosts table.
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg add network-dns-host 192.168.66.2 myhost
This command adds the specified IP address-hostname pair to the DNS table.
java -jar jrockitve-imagetool.jar -r app/vm.cfg remove network-dns-host 192.168.66.2 myhost
This command removes the specified IP address-hostname pair from the DNS .
network-dns-hosts
get network-dns-hosts remove network-dns-hosts ip-address
View all static host entries in the DNS hosts table or remove entries corresponding to the specified IP address.
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get network-dns-hosts
This command displays the entries in the DNS table of the virtual machine.
java -jar jrockitve-imagetool.jar -r app/vm.cfg remove network-dns-hosts 192.168.66.2
This command removes the DNS entry corresponding to the specified IP address.
network-dns-name
add network-dns-name domain-name get network-dns-name index remove network-dns-name index set network-dns-name index domain-name
Add, view, remove, or change a DNS domain name.
Note:
The DNS domain names are tried in the order in which they are defined in the lookup table. Make sure that the primary domain names are defined first.Parameter | Description |
---|---|
index | Index number of the entry (in the DNS server name lookup table) that you want to view, change, or remove.
For example, if you run #1 one.example.com #2 two.example.com The number shown at the beginning of each line in the output indicates the index number of the entry in the DNS server name lookup table. |
domain-name | Domain name for the DNS server entry to be changed or added (example: mycompany.com ). |
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg add network-dns-name example.com
This command adds the specified domain name to the DNS server name lookup table.
java -jar jrockitve-imagetool.jar -r app/vm.cfg get network-dns-name 1
This command displays the domain name corresponding to the first entry in the DNS server name lookup table.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set network-dns-name 1 two.example.com
This command changes the domain name for the first entry in the DNS server name lookup table.
java -jar jrockitve-imagetool.jar -r app/vm.cfg remove network-dns-name 1
This command removes the first entry in the DNS server name lookup table.
network-dns-names
get network-dns-names
View DNS domain names.
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg get network-dns-names
The command displays the entries in the DNS server name lookup table.
network-dns-server
add network-dns-server ip-address get network-dns-server index remove network-dns-server index set network-dns-server index ip-address
Add, view, remove, or change a DNS IP address.
Note:
The DNS servers are queried in the order in which they are defined in the lookup table. Make sure that the primary DNS servers are defined first.Parameter | Description |
---|---|
index | Index number of the entry (in the DNS server lookup table) that you want to view, change, or remove.
For example, if you run #1 172.22.23.24 #2 172.22.23.25 The number shown at the beginning of each line in the output is the index number of the entry in the DNS server lookup table. |
ip-address | IP address for the DNS server to be changed or added. |
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg add network-dns-server 172.22.23.26
This command adds the specified IP address to the DNS server name lookup table.
java -jar jrockitve-imagetool.jar -r app/vm.cfg get network-dns-server 1
This command displays the IP address corresponding to the first entry in the DNS server name lookup table.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set network-dns-server 1 172.22.23.27
This command changes the IP address for the first entry in the DNS server name lookup table.
java -jar jrockitve-imagetool.jar -r app/vm.cfg remove network-dns-server 1
This command removes the first entry in the DNS server name lookup table.
network-dns-servers
get network-dns-servers
View DNS server IP addresses.
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg get network-dns-servers
The command displays the entries in the DNS server name lookup table.
network-hostname
get network-hostname
remove network-hostname
set network-hostname hostname
View, remove, or change the network host name.
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get network-hostname
This command displays the network hostname of the virtual machine.
java -jar jrockitve-imagetool.jar -r app/vm.cfg remove network-hostname
This command removes the network hostname of the virtual machine.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set network-hostname myhost.com
This command sets the network hostname of the virtual machine to the specified value.
network-nic
add network-nic network nic-type add network-nic network nic-type ip-address netmask gateway mac add network-nic nic-type add network-nic nic-type ip-address add network-nic nic-type ip-address netmask gateway mac get network-nic index set network-nic index network nic-type set network-nic index network nic-type ip-address netmask gateway mac set network-nic index nic-type set network-nic index nic-type ip-address set network-nic index nic-type ip-address netmask gateway mac remove network-nic index
Add, view, remove, or change a network interface card (NIC).
Parameter | Description |
---|---|
index | Index number of the entry (in the NICs table) to be displayed or changed.
Note: Only one NIC is supported in the current release. |
network | Name for the NIC entry to be changed or added. |
nic-type | Network type: nat or bridged . |
ip-address | IP address for the NIC entry to be changed or added (required only if you want to use a static IP address).
If you do not specify the IP address, the NIC attempts to use DHCP to find its configuration. |
netmask | Net mask for the NIC entry to be changed or added (required only if you want to use a static IP address). |
gateway | Gateway for the NIC entry to be changed or added (required only if you want to use a static IP address). |
mac | MAC address for the NIC entry to be changed or added (required only if you want to use a static IP address) |
Note:
Any parameters that you do not specify (ip-address
, netmask
, or gateway
) will be determined by using DHCP.Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get network-nic 1
This command displays the network name (if it is defined) and the NIC type of the first NIC (index=1
) defined for the virtual machine.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set network-nic 1 nat
This command sets NAT as the type of the NIC.
java -jar jrockitve-imagetool.jar -r app/vm.cfg remove network-nic
This command removes the NIC.
java -jar jrockitve-imagetool.jar -r app/vm.cfg add network-nic 1 nat
This command adds a NIC of type NAT.
network-nics
get network-nics
View settings of network interface cards (NICs).
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg get network-nics
The command displays the index number, network name, and NIC type of the NICs defined for the virtual machine.
service
enable service service-name disable service service-name
Disable or enable a service.
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg enable service sshd
This command enables the sshd
service for the virtual machine.
java -jar jrockitve-imagetool.jar -r app/vm.cfg disable service sshd
This command disables the sshd
service for the virtual machine.
service-argument
add service-argument service-name argument remove service-argument service-name index
Add or remove an argument for a service that is enabled in a virtual machine.
Note:
If an argument contains spaces or other special characters, prefix each space and special character with an escape character: backslash (\
) on UNIX-like systems and caret (^
) on Windows.Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg add service-argument sshd port=4711
This command adds the argument port=4711
for the sshd
service.
Note:
Some services export their arguments through the service-specific--reconfigure-service
command. For example, to view the arguments that you can add for the sshd
service, run the following command:
java -jar jrockitve-imagetool.jar --reconfigure-service vm_cfg sshd get valid-arguments
The output of this command is a list of arguments that the sshd
service exports, as shown below.
port=<#> log=<quiet|brief|verbose|debug> no_auth
java -jar jrockitve-imagetool.jar -r app/vm.cfg remove service-argument sshd 1
This command removes the first argument that is currently configured for the sshd
service.
service-arguments
get service-arguments service-name
View the names of arguments specified for a service.
Example: java -jar jrockitve-imagetool.jar -r app/vm.cfg get service-arguments sshd
The command displays all the arguments that are currently defined for the sshd
service.
vm-name
get vm-name
set vm-name name
View or change the name of a virtual machine.
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get vm-name
This command displays the name of the virtual machine.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set vm-name myvm
This command changes the name of the virtual machine to myvm
.
working-dir
get working-dir
set working-dir path
View or change the name of the current working directory for a virtual machine. Relative paths are assumed to be in relation to the root (/) directory.
Examples
java -jar jrockitve-imagetool.jar -r app/vm.cfg get working-dir
This command displays the current working directory for the virtual machine.
java -jar jrockitve-imagetool.jar -r app/vm.cfg set working-dir /app
This command changes the working directory of the virtual machine to /app
.
Related Topics
Appendix B, "Configuration File Element Reference"
Section 4.1.3, "Disassembling and Re-Creating Virtual Machine Images"