4 Managing Instances

Viewing Information About an Instance

You can view information about Compute Classic instances in several ways.

Listing Instances

After creating instances in Compute Classic, you can view a list of your instances using the web console.

To complete this task, you must have the Compute_Monitor or Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  1. Sign in to your Cloud Account.
    • For Oracle Cloud, see Signing in to Your Cloud Account in Getting Started with Oracle Cloud.
    • For Oracle Cloud at Customer, click the Infrastructure Classic Console URL from the welcome email.
    The Infrastructure Classic Console is displayed.
  2. Click the Navigation menu icon in the top left corner of the Dashboard.
  3. Under Services, click Compute Classic.
    The Compute Classic console is displayed.
  4. (Optional) This step is relevant only if your domain spans multiple sites. To change the site, click the Site menu near the top of the page.

Your instances are listed on the Instances page. For each instance, you can view details including the label, the current status, the attached storage volumes, and the public and private IP addresses associated with it. If your instance has an interface on the shared network, the public IP address on the shared network is displayed. Otherwise, if the instance has one or more interfaces on IP networks, the public IP address associated with the interface that is used as the default gateway is displayed.

You can start, stop, or reboot an instance by selecting the instance and clicking the appropriate icon at the top of the list.

To list your instances using the CLI, use the opc compute instance list command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To list your instances using the API, use the GET /instance/container/ method. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.

Monitoring Instances

After creating instances in Compute Classic, you can view a list of your instances and get details of each instance.

To complete this task, you must have the Compute_Monitor or Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. The Instances page shows a list of instances, along with information about each instance.

    Tip:

    You can filter the list of instances according to their category or status. To list instances with a specific status (such as running, error, or stopped), click the Show menu and select the appropriate filter. To view instances of a specific category (such as PaaS, IaaS, or personal), click the Category menu and select the appropriate filter.

  3. Go to the instance that you want to view. From the menu icon menu, select View.
    The instance details page shows all the details of the selected instance, such as the public and private IP addresses associated with it and details of interfaces added to IP networks. You can stop, start, or reboot the instance by clicking the appropriate icon at the top of the page. This page also displays the orchestration used to create the instance, and the storage volumes, security lists, and SSH keys associated with it. You can add or remove storage volumes and security lists from this page. For more information, see Updating an Instance.

To view details of an instance using the CLI, use the opc compute instance get command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To view details of an instance using the API, use the GET /instance/name method. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.

Viewing Instance Metrics

You can view real-time metrics of your Compute Classic instances.

You can access the Monitoring page for your Compute Classic account from the Infrastructure Classic Console. On this page, you can select the type of metric you want to view and to specify up to five instances for each metric. After you configure the metrics that you want to view, the graphs show you the selected metrics for the past two hours for the specified instances. These metrics are automatically updated every minute.

To complete this task, you must have the Compute_Monitor or Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

To view instance metrics:

  1. Sign in to the Oracle Cloud Infrastructure Classic Console at https://cloud.oracle.com/sign-in.
    The Oracle Cloud Infrastructure Classic Console page is displayed.
  2. Click the Navigation menu icon in the top left corner of the Dashboard.
  3. Click Monitoring.
    The Monitoring Metrics page of the Infrastructure Classic Console opens.
  4. From the list of metrics, select the metrics that you want to see. You can select up to four metrics. The following metrics are available:
    • CPU (%): Indicates CPU utilization in percentage.
    • IOStat Read (sectors): Indicates the average number of sectors read in I/O operations per second.
    • IOStat Write (sectors): Indicates the average number of sectors written in I/O operations per second.
    • Memory Percent (%): Indicates memory utilization in percentage.
    • Memory Usage (KB): Indicates memory utilization in kilobytes.
    • Memory Utilization Percentage (agent): Indicates memory utilization in percentage, as reported by the OPC agent, if the agent is enabled. The memory utilization metrics reported by this agent are more accurate than the memory utilization reported by the Memory Percent metric. When the OPC agent isn’t installed and enabled, no value is displayed. To install and enable the agent, see Enabling Instance Metrics Collection.
    • Memory Utilization (agent): Indicates memory utilization in kilobytes, as reported by the OPC agent, if the agent is enabled. The memory utilization metrics reported by this agent are more accurate than the memory utilization reported by the Memory Usage metric. When the OPC agent isn’t installed and enabled, no value is displayed. To install and enable the agent, see Enabling Instance Metrics Collection.
    • Network Rcvd (B/s): Indicates the average network traffic received by the instance in bytes per second.
    • Network Sent (B/s): Indicates the average network traffic sent by the instance in bytes per second.
    For more information about selecting the instances and metrics that you want to view, see Monitoring Service Usage in Managing and Monitoring Oracle Cloud.

You can also view metrics using the Oracle Monitoring Cloud Service REST API. See Rest API for Oracle Monitoring Cloud Service.

Enabling Instance Metrics Collection

You can view instance-level metrics from the Monitoring page in the web console. This page shows statistics about I/O operations, CPU utilization, network traffic, and memory utilization on your instance. The opc-init package also includes an agent to collect metrics. This agent runs on the instance and provides highly accurate memory utilization statistics, based on data that is collected every minute.

  • On instances created using Oracle-provided Oracle Linux images with release version 16.4.6 or later, the agent is installed and enabled by default.

  • On instances created using Oracle-provided Oracle Linux images with release version 16.4.4, the agent is installed and disabled by default. To enable the agent, see Enabling and Disabling the OPC Agent.

  • On Oracle Linux instances created using older images, or on Oracle Linux instances created using private images where opc-init is not installed, the agent isn’t installed. To install the agent, download and install opc-init. See Downloading and Installing the OPC Agent on an Oracle Linux Instance.

Note:

You can use the OPC agent only on Oracle Linux 6.x and Oracle Linux 7.x instances. This agent isn’t supported on Windows or Solaris instances.

Downloading and Installing the OPC Agent on an Oracle Linux Instance

If your instance was created using an Oracle-provided image with release version 16.3.6 or older, or if your instance uses a private machine image on which opc-init isn’t installed, then to use the agent you must download and install opc-init.
  1. Determine the version of Python on your instance.

    python --version
  2. Download the opc-init package from http://www.oracle.com/technetwork/topics/cloud/downloads/opc-init-3096035.html.

  3. Extract the files in the package.

  4. Copy the appropriate file to your instance.

    • opc-init-py2.6-version.noarch.rpm — for Linux with Python 2.6

    • opc-init-py2.7-version.noarch.rpm — for Linux with Python 2.7

    Here, version indicates the release version of the opc-init package.

    Note:

    The opc-init package includes a .exe file for installing opc-init on Windows. While you can use this file to install opc-init on a Windows instance, the OPC agent isn’t supported on Windows and it won’t be installed on a Windows instance.

  5. Log in to your instance and check if opc-init is installed.

    rpm -qa | grep opc-init

    If this command doesn’t return any output, it indicates that opc-init isn’t installed on your instance.

  6. Install the appropriate file.

    • If opc-init isn’t installed on your instance, then, to install opc-init on an instance with Python 2.6:

      sudo rpm -i opc-init-py2.6-version.noarch.rpm
    • If an earlier version of opc-init is already installed on your instance, then use the upgrade option. For example, on an instance with Python 2.6:

      sudo rpm -Uvh opc-init-py2.6-version.noarch.rpm
  7. Verify the installation:

    rpm -qa | grep opc-init

    The output of this command should show the opc-init file that you just installed.

Enabling and Disabling the OPC Agent

If you’ve downloaded and installed opc-init on your Oracle Linux instance, or if you’ve created an instance using an Oracle-provided Oracle Linux image with release version 16.4.6 or later, the OPC agent is installed on your instance and enabled by default. If you’ve created an instance using an Oracle-provided Oracle Linux image with release version 16.4.4, the OPC agent is installed and disabled by default.

  • On Oracle Linux 7.x

    • To enable the agent:

      systemctl start opc-guest-agent.service
    • To disable the agent:

      systemctl stop opc-guest-agent.service
    • To check the status of the agent:

      systemctl status opc-guest-agent.service
  • On Oracle Linux 6.x

    • To enable the agent:

      sudo start opc-guest-agent-service

      To check the status of the agent:

      sudo status opc-guest-agent-service

      When the agent is running, this command gives the following sample output:

      opc-guest-agent-service start/running, process 1578
      
    • To disable the agent:

      sudo stop opc-guest-agent-service

      To check the status of the agent:

      sudo status opc-guest-agent-service

      When the agent is stopped, this command gives the following output:

      opc-guest-agent-service stop/waiting
  • If you stop and restart, or delete and re-create, an instance that uses a persistent boot disk, you don’t need to install opc-init again.

  • If you delete and re-create an instance that uses a nonpersistent boot disk, and if opc-init wasn’t installed by default on that instance, you must download and install opc-init again.

Viewing the Metrics Reported by the OPC Agent

The following memory utilization metrics are reported by the OPC agent:

  • Memory Utilization Percentage (agent): Indicates the actual memory utilization on the instance, in percentage.

  • Memory Utilization (agent): Indicates the actual memory utilization on the instance, in kilobytes.

Note:

When the OPC agent is disabled, no value is displayed for these metrics.

To view instance metrics, see Viewing Instance Metrics.

Viewing the Boot Log of an Instance

After creating an instance in Compute Classic, you can view the boot log of the instance. If there are any issues after an instance has started or while restarting an instance, viewing the boot log helps you to detect those issues.

Boot logs are enabled by default in Oracle-provided images from mid-May 2016 onwards. For instances created using any other images, boot logs might not be visible by default. In this case, you can log in to the instance and configure it to show boot logs on the web console. See How can I access the boot log for my instance?

To complete this task, you must have the Compute_Monitor or Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. The Instances page shows a list of instances. Go to the instance for which you want to view the boot log. From the menu icon menu, select View.
  3. On the instance details page, click the Logs tab in the left pane.
    The Logs page displays the boot log for the instance. The output from the latest start or restart is displayed.

    Note:

    Boot logs are truncated at 81920 bytes.

    Note:

    If your instance isn’t configured to display boot logs, the Logs page displays a message stating that no log was found.

    The following is a sample output of a boot log, which has been truncated for readability:

    user pid=8847 uid=0 auid=0 ses=674 msg='op=PAM:setcred acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
    [341545.271630] type=1106 audit(1462252801.375:4058): user pid=8847 uid=0 auid=0 ses=674 msg='op=PAM:session_close acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
    [342145.291725] type=1101 audit(1462253401.394:4059): user pid=8855 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
    [342145.315757] type=1103 audit(1462253401.418:4060): user pid=8855 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
    ...
    ...
    ...
    [345145.356807] type=1103 audit(1462256401.460:4096): user pid=8918 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
    [345145.372663] type=1006 audit(1462256401.476:4097): pid=8918 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=681
    [345145.383251] type=1105 audit(1462256401.486:4098): user pid=8918 uid=0 auid=0 ses=681 msg='op=PAM:session_open acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
    [345145.440485] type=1104 audit(1462256401.543:4099): user pid=8918 uid=0 auid=0 ses=681 msg='op=PAM:setcred acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
    [345145.458101] type=1106 audit(1462256401.560:4100): user pid=8918 uid=0 auid=0 ses=681 msg='op=PAM:session_close acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'

To view instance console output using the CLI, use the opc compute instance-console get command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To view instance console output using the API, use the GET /instanceconsole/name method. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.

Generating a Screen Capture of an Instance

After creating an instance, if your instance is in the running state, you should be able to log in to your instance. However, if you’re unable to access an instance that is in the running state and you need information to help you understand why you’re not able to access the instance, you can generate a screen capture of the instance. The screen capture images are stored in the associated Oracle Storage Cloud Service account.

Prerequisites

  • Screen capture image files are stored in the associated Oracle Storage Cloud Service instance. Ensure that you’ve set a replication policy for your Oracle Storage Cloud Service instance. See Selecting a Replication Policy for Oracle Storage Cloud Service in Using Oracle Storage Cloud Service.

  • To complete this task, you must have the Compute_Monitor or Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Procedure

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. The Instances page shows a list of instances. Go to the instance for which you want to generate a screen capture. From the menu icon menu, select View.
  3. On the instance details page, click the Screen Captures tab in the left pane.
    The Screen Captures page is displayed.
  4. To generate a screen capture, click Create Screen Capture. A screen capture is created and displayed. It is also added to the list of screen captures.
  5. To view an existing screen capture of the instance, select it from the list. Screen captures are listed in reverse chronological order, with the most recent screen captures on top.
  6. If you no longer need a screen capture, you can delete it. The corresponding screen capture image in the associated Oracle Storage Cloud Service account is deleted.

To generate a screen capture of an instance using the API, use the POST /console/screencapture/ method. You must specify the instance you want a screen capture of as well as the Oracle Storage Cloud Service account associated with your Oracle Compute Cloud Service account. The screen capture image is generated and saved in the associated Oracle Storage Cloud Service account. The path to access this screen capture file is returned in the response to your API call. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.

After you’ve generated a screen capture using the API, to view the file, download it from your Oracle Storage Cloud Service account. See Downloading an Object in Using Oracle Storage Cloud Service.

Updating Packages on an Oracle Solaris Instance

Not Oracle Cloud at Customer This topic does not apply to Oracle Cloud at Customer.

When you create instances by using an Oracle-provided Oracle Solaris image, you get a support entitlement for Oracle Solaris. You can update packages from the support repository, file service requests to get support, and so on. The default IPS publisher, named solaris, is preconfigured to use the Oracle Solaris support repository (https://pkg.oracle.com/solaris/support/).

Checking Whether the SSL Key and Certificate of the IPS Publisher Are Associated

  1. Log in to your Oracle Solaris instance as the opc user:

    ssh opc@ip_address -i /path/to/private_key

  2. Run the following command:

    pkg publisher solaris

    • If the SSL Key and SSL Cert fields have values and if the certificate hasn’t expired yet (see the Cert. Expiration Date field, as shown in the following example), then proceed to Updating Packages.
                  Publisher: solaris
                      Alias:
                 Origin URI: https://pkg.oracle.com/solaris/support/
                    SSL Key: /var/pkg/ssl/0ea8b04aa00e4ea1621aa66cab649778b67ef486
                   SSL Cert: /var/pkg/ssl/66aac7c266473f285641fef2b8e6817248cb7f4e
       Cert. Effective Date: March 27, 2016 09:10:48 AM
      Cert. Expiration Date: April  4, 2018 09:10:48 AM
                Client UUID: 0717ae7e-bb12-11e5-9a62-9bd968ceffe9
            Catalog Updated: March 24, 2016 03:53:33 PM
                    Enabled: Yes
    • If the SSL Key and SSL Cert fields show None, or if they show a value but the certificate has expired, then complete the steps in Associating the SSL Key and Certificate for the IPS Publisher.

Associating the SSL Key and Certificate for the IPS Publisher

You must complete the steps in this section if the pkg publisher solaris command shows that the SSL key and certificate are not associated, or if the command shows that the certificate is associated but has expired.

  1. Go to https://pkg-register.oracle.com/.
  2. Click Request Certificates.
  3. On the Available Repositories page, look for the Oracle Solaris 11 Support row, and click Request Access.
  4. Read and accept the My Oracle Support terms.
  5. Go to https://pkg-register.oracle.com/register/certificate/ and download your key and certificate to your local host.
  6. Copy the key and certificate from your local host to your Oracle Solaris instance:

    scp pkg.oracle.com.*.pem opc@ip_address:~

    Here, ip_address is the public IP address of your Oracle Solaris instance. This command copies pkg.oracle.com.key.pem and pkg.oracle.com.certificate.pem from your local host to the /export/home/opc directory of your Oracle Solaris instance.

  7. Log in to your Oracle Solaris instance as the opc user:

    ssh opc@ip_address -i /path/to/private_key

  8. Assume the root role:

    su -

  9. Set up the publisher configuration:
    pkg set-publisher \
           	    -k /export/home/opc/pkg.oracle.com.key.pem \
           	    -c /export/home/opc/pkg.oracle.com.certificate.pem \
           	    -G "*" -g https://pkg.oracle.com/solaris/support/ solaris

Updating Packages

  1. Verify that the SSL key and certificate are set for the IPS publisher.

    See Checking Whether the SSL Key and Certificate of the IPS Publisher Are Associated.

  2. Update the packages:
    • To list the packages available in the repository:

      pkg list -a 'pkg://solaris/*'

    • To do a dry run of an update:

      pkg update -nv

    • To update all packages:

      pkg update

  3. Wait for the update operation to be completed.
    After all the packages are updated, messages such as the following are displayed:
               Packages to install:   1
                Packages to update: 154
           Create boot environment: Yes
    Create backup boot environment:  No
    
    DOWNLOAD               PKGS         FILES      XFER (MB)    SPEED
    Completed              155/155      7607/7607  307.0/307.0  3.0M/s
    
                                                   ITEMS
    Removing old actions                         732/732
    Installing new actions                     1317/1317
    Updating modified actions                  7658/7658
    Updating package state database                 Done
    Updating package cache                       154/154
    Updating image state                            Done
    Creating fast lookup database                   Done
    Updating package cache                           1/1
    
    A clone of solaris exists and has been updated and activated.
    On the next boot the Boot Environment solaris-1 will be
    mounted on '/'.  Reboot when ready to switch to this updated BE.
    
    Updating package cache                           1/1
    
    ---------------------------------------------------------------
    NOTE: Please review release notes posted at:
    
    https://support.oracle.com/rs?type=doc&id=2045311.1
    ---------------------------------------------------------------
  4. In the output, note the name of the new boot environment (BE), solaris-1 in this example.

  5. To verify that the new BE exists, run the following command:

    beadm list

    Here’s an example of the output of this command:
    BE        Flags Mountpoint Space  Policy Created
    --        ----- ---------- -----  ------ -------
    solaris   N     -          58.68M static 2016-02-23 23:59
    solaris-1 R     /          6.49G  static 2016-04-04 11:34
    In this example, two BEs exist on the instance:
    • The currently active solaris BE, indicated by the N (=active now) flag
    • The new solaris-1 BE, indicated by the R (=active on reboot) flag
  6. For the new BE to take effect, restart the instance. See Rebooting an Instance.