Skip Headers

Oracle® JRockit Virtual Edition User's Guide Release 2.0.0 Part Number E22518-01 |
Home | Contents | Contact Us

Previous | Next
| View PDF

# B.3 jrockitve-config (mandatory)

This element and its child elements define the configuration settings of the virtual machine.

Attributes

Name | Description | Mandatory / Optional
--- | --- | ---
memory | Maximum memory available to the virtual machine. | Mandatory
cpus | Number of CPUs available to the virtual machine. You can configure a maximum of eight virtual CPUs. | Mandatory

You can specify the following units (not case sensitive) for the `memory` attribute:

- `K` or `KB`: Kilobytes

- `M` or `MB`: Megabytes

- `G` or `GB`: Gigabytes

- `T` or `TB`: Terabytes

If you do not specify the unit, the Image Tool assumes that the values are specified in megabytes.

Example

    <jrockitve-config memory="256 MB" cpus=2>

Child Elements

- storage (mandatory)

- services (optional)

- vm-name (mandatory)

- working-dir (optional)

- java-arguments (mandatory)

- network (mandatory)

- locale-data (optional)

- console-log-path (optional)

## B.3.1 storage (mandatory)

The `storage` element is a container for configurations of disks and mounts.

Child Elements

- disks (mandatory)

- mounts (mandatory)

Example

    <storage>
       <disks>
          <disk id="root" size="512 MB"/>
        </disks>
        <mounts>
           <mount>
              <mount-point>/</mount-point>
              <disk>root</disk>
           </mount>
           <mount type="nfs">
              <mount-point>/test1</mount-point>
              <server>nfs.mycompany.com</server>
              <server-path>/export/test1</server-path>
              <options>
                 <option>uid=513</option>
                 <option>gid=503</option>
              </options>
           </mount>
        </mounts>
    </storage>

### B.3.1.1 disks (mandatory)

This element is a container for the `disk` element.

#### B.3.1.1.1 disk (mandatory)

This element defines the properties of the root disk.

If you change the disk size, the virtual machine image is resized (shrunk or expanded) to the new size specified. If the image cannot be expanded to the specified size due to insufficient disk space, an error message is displayed.

If the Java application to be converted into a virtual machine image contains more data than the disk size specified, when the Image Tool assembles the virtual machine image, it overrides (but does not change) the disk size specified in the configuration XML file and proceeds with the assembly.

Attributes

Name | Description | Mandatory / Optional
--- | --- | ---
id | A string that identifies the disk | Mandatory
size | An integer value that specifies the size of the disk | Mandatory

You can specify the following units (not case sensitive) for the `size` attribute:

- `K` or `KB`: Kilobytes

- `M` or `MB`: Megabytes

- `G` or `GB`: Gigabytes

- `T` or `TB`: Terabytes

If you do not specify the unit, the Image Tool assumes that the values are specified in megabytes.

Example

    <disk id="root" size="512 MB"/>

### B.3.1.2 mounts (mandatory)

This element is a container for mounts defined by the `mount` element.

#### B.3.1.2.1 mount (mandatory)

This element defines the settings for mount points.

Attribute

Name | Description | Mandatory / Optional | Default Value
--- | --- | --- | ---
type | The mount type: `nfs` or `native` | Optional | native

The configuration file should contain one (and only one) `native` mount that maps the native disk defined for the virtual machine to the root (`/`) directory of the virtual machine.

There can be any number of `nfs` mounts.

Child Elements

- mount-point (mandatory)

  This element specifies the absolute path in the file system of the virtual machine to which the native disk and the NFS locations defined for the virtual machine should be mapped.

  Note:

  You must specify the path in the POSIX format by using slashes (/) as delimiters.

  A slash (/) at the beginning of the path represents the root directory. A period (.) at the beginning of the path represents the current directory. Two periods (..) indicate the parent directory.

- disk (mandatory)

  This element is mandatory (and allowed) only for mounts of type `native`. It allows you to map the native disk defined for the virtual machine to the root (/) directory of the virtual machine.

  The value of this element is the `id` specified for the native `disk` within the `disks` element.

- server (mandatory)

  This element is mandatory (and allowed) only for mounts of type `nfs`. It specifies the server that contains the NFS location. It is a string representing a server name or an IP address.

- server-path (optional)

  This element is mandatory (and allowed) only for mounts of type `nfs`. It specifies the directory path of the NFS location.

- options (optional)

  This element is allowed only for mounts of type `nfs`. It contains one or more `option` elements that specify configuration settings for NFS mount points: `uid`, `gid`, and so on.

Example

    <mounts>
       <mount type="native">
          <mount-point>/</mount-point>
          <disk>root</disk>
       </mount>
       <mount type="nfs">
          <mount-point>/test1</mount-point>
          <server>nfs.mycompany.com</server>
          <server-path>/export/test1</server-path>
          <options>
             <option>uid=513</option>
             <option>gid=503</option>
          </options>
       </mount>
    </mounts>

## B.3.2 services (optional)

This element is a container for one or more `service` elements, which specify the properties of the services that are enabled for the virtual machine.

Example

    <services>
       <service name="sshd"/>
          <arguments>
             <argument>port=4711</argument>
             <argument>no_auth</argument>
          </arguments>
       </service>
    </services>

### B.3.2.1 service (optional)

This element contains specifies the name of the enabled service, and is a container for the `arguments` element.

### B.3.2.2 arguments (optional)

This element is a container for one or more `argument` elements, which specify service-specific arguments.

You can find out what service arguments can be configured for a service by using the --reconfigure-service command-line option of the Image Tool. For example, to find out the service arguments that can be configured for the `sshd` service, run the following command:

    java -jar jrockitve-imagetool.jar --reconfigure-service vm_cfg sshd get valid-arguments

This command might produce output that resembles the following:

    port=<#>
    log=<quiet|brief|verbose|debug>
    no_auth

## B.3.3 vm-name (mandatory)

This element specifies the name of the virtual machine as it would appear to Oracle VM. The name can contain only the following characters: A–Z, a–z, 0–9, period (`.`), hyphen (-), and underscore (_).

If you do not specify this element, when the Image Tool assembles the virtual machine image, it uses the name `default-vm`.

Example

    <vm-name>my_vm</vm-name>

## B.3.4 working-dir (optional)

This element specifies the directory in the file system inside a virtual machine image that should serve as the working directory for the JRockit JVM (the default location in which crash files, for example, are created).

Note:

You must specify the path in the POSIX format by using slashes (/) as delimiters.

The default working directory is the root (`/`) directory in the file system of the virtual machine.

## B.3.5 java-arguments (mandatory)

This element specifies the Java arguments for the virtual machine and the Java application.

Note:

You must specify the path in the POSIX format by using slashes (/) as delimiters.

A slash (/) at the beginning of the path represents the root directory of the virtual machine. A period (.) at the beginning of the path represents the current directory. Two periods (..) indicate the parent directory.

To specify the Java home directory of the JDK in the file system inside a virtual machine image (`/jrockitve/jrockit`) as part of a Java argument, you can use the `$JAVA_HOME` variable. For example, in an argument that points to the `/jrockitve/jrockit/lib/tools.jar` file, you can specify the path as `$JAVA_HOME/lib/tools.jar`.

Example

    <java-arguments>-cp $JAVA_HOME/lib/tools.jar:. -Xmx128m -jar App.jar arg0
    </java-arguments>

## B.3.6 network (mandatory)

This element specifies the configuration for network interface cards (NICs) and DNS servers.

Child Elements

- dns (optional)

- nics (mandatory)

- routes (optional)

- hostname (optional)

Example: Detailed Network Configuration

    <network>
       <dns>
          <static-hosts>
             <hosts ip="192.168.1.34">
                <host>test</host>
             </hosts>
             <hosts ip="10.0.1.56">
                <host>thefiftysix.mycompany.com</host>
                <host>the56.mycompany.com</host>
             </hosts>
          </static-hosts>
          <server-order>
             <server ip="172.22.17.100"/>
             <server ip="192.168.1.2"/>
          </server-order>
          <lookup-order>
             <name suffix="us.mycompany.com"/>
             <name suffix="in.mycompany.com"/>
          </lookup-order>
       </dns>
       <nics>
          <nic network="eth0" type="nat">
             <ip>172.23.22.22</ip>
             <netmask>255.255.255.0</netmask>
             <gateway>172.23.22.1</gateway>
             <mac>12:ab:34:cd:56:ef</mac>
          </nic>
       </nics>
       <hostname>example</hostname>
    </network>

Example: Minimum Network Configuration

The minimum network configuration example specifies a single network interface card (NIC) that uses DHCP over a bridged network.

    <network>
       <nics>
          <nic/>
       </nics>
    </network>

### B.3.6.1 dns (optional)

This element is a container for DNS information in the configuration file. It should be used when the DNS information needs to be passed to Oracle JRockit Virtual Edition.

Note:

This element is mandatory only if you do not want to use DHCP for DNS configuration.

Child Elements

- static-hosts (optional)

  This element allows you to add static DNS entries (similar to the `/etc/hosts` file on UNIX-like systems, for example).

  It contains a list of host names specified by one or more `hosts` elements. More than one host name can be mapped to one IP address that is defined by the `ip` attribute of the `hosts` element.

- server-order (optional)

  This element contains a list of DNS server IP addresses specified by one or more `server` elements. The order of the IP addresses in the list indicates the lookup order.

- lookup-order (optional)

  This element contains a list of DNS server names specified by one or more `name` elements. The order of the DNS server names in the list indicates the lookup order.

Note:

The DNS domain names and servers are tried in the order in which they are defined in the lookup table. Make sure that the primary domain names and primary servers are defined first.

Example

    <dns>
       <static-hosts>
          <hosts ip="192.168.1.34">
             <host>test</host>
          </hosts>
          <hosts ip="10.0.1.56">
             <host>us.mycompany.com</host>
             <host>in.mycompany.com</host>
          </hosts>
       </static-hosts>
       <server-order>
          <server ip="172.22.17.100"/>
          <server ip="192.168.1.2"/>
       </server-order>
       <lookup-order>
          <name suffix="abc.com"/>
          <name suffix="xyz.com"/>
       </lookup-order>
    </dns>

### B.3.6.2 nics (mandatory)

This element is a container for the `nic` element.

Example

    <nics>
       <nic network="eth0" type="bridged">
          <ip>172.123.122.122</ip>
          <netmask>255.255.255.0</netmask>
          <gateway>172.123.122.1</gateway>
          <mac>12:ab:34:cd:56:ef</mac>
        </nic>
    </nics>

#### B.3.6.2.1 nic (mandatory)

This element specifies the configuration of the network interface card (NIC) available for the virtual machine.

Attributes | Description | Mandatory / Optional | Default Value
--- | --- | --- | ---
network | Name to identify the NIC | Optional | NA
type | Mode that the NIC must use to connect to the physical network from the virtual machine Possible values: `bridged`: Connect to the physical network through the physical NIC on the machine in which the virtual machine is running `nat`: Network address translation mode | Optional | bridged

Child Elements

- ip (optional)

  This element specifies the IP address of the NIC. It is mandatory only for static IP configuration.

  Note:

  You can specify a static IP address, and leave `netmask` and `gateway` undefined (that is, to be determined by using DHCP).

- netmask (optional)

  This element specifies the netmask address (in dot-separated decimal octet format) of the NIC. It is mandatory only if you do not want to use DHCP for netmask configuration.

- gateway (optional)

  This element specifies the gateway address (in dot-separated decimal octet format) of the NIC. It is mandatory only if you do not want to use DHCP for gateway configuration.

- mac (optional)

  This element specifies the MAC address (in colon-separated hexadecimal octet format) of the NIC. If you do not specify this element, Oracle VM assigns a MAC address.

Example: Detailed Configuration

    <nic network="eth0" type="bridged">
        <ip>172.123.122.122</ip>
        <netmask>255.255.255.0</netmask>
        <gateway>172.123.122.1</gateway>
        <mac>12:ab:34:cd:56:ef</mac>
    </nic>

Example: Minimum Configuration

    </nic>

The minimum configuration example specifies a single NIC (without an identifying name) that uses DHCP over a bridged network.

### B.3.6.3 routes (optional)

This element is a container for the `route` element.

Example

    <routes>
       <route>
          <mtu>1500</mtu>
          <gateway>173.23.22.1</gateway>
          <nic>nic0</nic>
       </route>
       <route>
          <mtu>1500</mtu>
          <destination-ip>10.161.184.0</destination-ip>
          <netmask>255.255.0.0</netmask>
          <nic>nic0</nic>
       </route>
    </nics>

#### B.3.6.3.1 route (mandatory)

This element specifies each entry in the routing table.

Child Elements

- mtu (optional)

  This element specifies Maximum Transmission Unit size for a route.

  Tunnels which perform some form of protocol encapuslation require reduced MTU. Most tunnels enforce this automatically by rewriting TCP SYN packet MSS option. Other protocols prove troublesome (for example, UDP) where this MTU may provide the correct IP fragmentation size.

- destination-ip (optional)

  This element specifies the destination IP address to match this route.

- netmask (optional)

  This element specifies the netmask address (in dot-separated decimal octet format) to consider 'destination-ip'.

- gateway (optional)

  This element specifies the gateway address (in dot-separated decimal octet format) through which packets must be routed through, that is, if the packets are to leave the directly attached subnet.

- nic (mandatory)

  This element specifies the network interface to route to.

### B.3.6.4 hostname (optional)

This element specifies the host name of the virtual machine.

Example

    <hostname>example</hostname>

## B.3.7 locale-data (optional)

This element specifies the locale information (language, time zone, and character encoding) for the virtual machine. If you do not specify this element, the virtual machine uses the locale settings of the machine on which it was created (assembled).

Child Elements

- locale (optional)

  This element specifies the name of the locale.

- timezone (optional)

  This element specifies the time zone.

- encoding (optional)

  This element specifies the character encoding to be used for the locale.

Example

    <locale-data>
       <locale>en_UK</locale>
       <timezone>Europe/London</timezone>
       <encoding>ISO-8859-1</encoding>
    </locale-data>

## B.3.8 console-log-path (optional)

This element specifies the directory path and the name of the file in which the virtual console log messages should be stored. The console log contains the output of the Java application and Oracle JRockit Virtual Edition.

The log file location specified by using this element might contain several files as a result of log-file rotation. Oracle JRockit Virtual Edition rotates log files as follows: Every time the virtual machine starts, the existing contents of the main log file are moved to `log_file``.old.1`, the contents of `log_file``.old.1` are moved to `log_file``.old.2`, and so on, up to `log_file``.old.9`.

By default, virtual console log messages are written to `/jrockitve/log/jrockitve.log` in the file system of the virtual machine. Change the log location only when absolutely essential to use a different location.

Note:

You must specify the path in the POSIX format by using slashes (/) as delimiters.

A slash (/) at the beginning of the path represents the root directory. A period (.) at the beginning of the path represents the current directory. Two periods (..) indicate the parent directory.

Example

    <console-log-path>/test/mylog.log</console-log-path>