Creating an Instance Using a Private Image

You can build a custom image and use it to create Compute Classic instances.

When you create an instance using the Create Instance wizard, a single orchestration v2 is created automatically to manage the instance and its associated resources. Storage volumes and networking objects used by the instance are created in the same orchestration. Instances are nonpersistent by default. However, storage volumes and other objects are created with persistence set to true, so that if you suspend the orchestration, instances are shut down, but storage volumes aren’t deleted. Terminating the orchestration, however, will cause all objects to be deleted and any data on storage volumes will be lost.

For more information about using orchestrations to manage your instances and other resources, see Managing Resources Using Orchestrations v2.

Prerequisites

  • To complete this task, you must have the 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.

  • The custom machine image that you want to use must already be available as a machine image in Compute Classic. See Workflow for Creating Instances Using a Private Machine Image for information about creating, uploading, and registering your custom machine images.

Procedure

  1. Sign in to the Compute Classic console.
  2. (Optional) If your domain spans multiple sites, then check that the site you’ve selected has sufficient capacity to create the required resources. Click Site near the top of the page to view the aggregate resource usage by all tenants on the currently selected site. If resource usage on the selected site is close to maximum, pick another site.

    If you’re using the REST API to create resources, note the API end point of the site that you want to use.

  3. Click the Images tab.
    The Private Images page is displayed.
  4. The Private Images page lists images you’ve created as well as images you’ve got from Oracle Cloud Marketplace. Go to the image that you want to use, and from the menu icon menu, select Create Instance.
    The Create Instance wizard starts.
  5. The Image page of the Create Instance wizard shows the custom image that you selected. After selecting this image, you can click Review and Create to accept the default settings and create your instance.

    Note:

    If you select an image and then accept the default settings, your instance is created with the following configuration:
    • Uses the smallest applicable shape.
    • Has the high-availability (HA) policy set to Active.
    • Uses the default name and label.
    • Uses a persistent boot disk. You won’t be able to create an instance snapshot of this instance.
    • Has an autogenerated public IP address.
    • Is added to the default security list.
    • Isn’t added to any IP networks.
    • Doesn’t have a description, tags, a DNS host name prefix, or custom attributes (unless specified in the image).
    • Doesn’t have any SSH keys associated with it.

    Caution:

    If you accept the default settings and click Review and Create, your instance won’t have any SSH keys associated with it. This means that you won’t be able to access the instance using SSH. An SSH key is required when you create an Oracle Linux or an Oracle Solaris instance, because you must use SSH to access these instances. Go to the Instance page of the Create Instance wizard to specify an SSH public key to be associated with your instance.

  6. On the Shape page, select the shape that you want to use. The shape specifies the OCPU and memory resources to be allocated to the instance. If you select a high I/O shape, an NVMe SSD disk is automatically attached to your instance. This is a local, nonpersistent NVMe SSD disk, which provides high I/O access rates. This disk is attached to your instance with the device name /dev/xvdz. After your instance is created, you can mount this disk and format it as required. The size of this NVMe SSD disk is fixed depending on the selected shape.

    Note:

    High I/O shapes aren’t available in all regions.

    For more information about shapes, see About Shapes.

    After selecting a shape, click the button to go to the next page.

  7. On the Instance page, select or enter the following, and then click the button to go to the next page:
    • Persistent: (Available only on Oracle Cloud at Customer)

      Because instances are nonpersistent by default, the instance is deleted when you suspend the relevant orchestration. This allows you to update the properties of the instance by suspending the orchestration. If a persistent boot disk is attached to the instance, no data or configuration is lost. After updating the properties of the instance, you can recreate it by starting the orchestration.

      If you use this option to specify that the instance must be persistent, then, if you want to update the instance later on without stopping any of the other objects created by this orchestration, remember to update the instance to be nonpersistent at that time.

    • Placement: As there is a single domain, the instance is created in this domain when you select Auto or Specific Domain.

    • Name: Enter a name for your instance, or accept the default.

      Note that the full name of an instance has the following format: /Compute-identity_domain/user/name/id. Here id is an autogenerated ID.

      Examples of Instance Names:

      • If you accept the default value suggested in the Create Instance wizard (for example, 20160422104055):

        /Compute-myDomain/jack/20160422104055/300a7479-ec90-4826-98b9-a725662628f1

      • If you specify a name in the Create Instance wizard (for example, vm1 ) :

        /Compute-myDomain/jack/vm1/300a7479-ec90-4826-98b9-a725662628f1

    • Label: Enter a label for the instance or accept the default. A label can contain only alphanumeric characters, hyphens, and underscores. It can’t contain unicode characters.

      Enter a label that’s meaningful and that you can use to identify the instance easily later. Try to assign a unique label for each instance. This label is displayed on the instance details page.

    • Description: (Optional) Enter a description.

    • Tags: (Optional) Specify one or more tags to help you identify and categorize the instance.

    • SSH Keys: (Optional) Specify the SSH keys that you want to associate with this instance. Click this field or start typing to see a list of available SSH public keys.

      Note:

      You don’t need to do this if you’re creating a Windows instance, because you can’t log in to a Windows instance using SSH.

      To add a new SSH public key:

      1. Click Add SSH Public Key.

      2. Enter a name for the SSH public key.

      3. In the Value field, click Select File. Navigate to the path where your SSH key is saved, and select the SSH public key file that you want to add. The value of the SSH key appears in the field.

        Alternatively, you can paste the value of the SSH public key that you want to add.

        Important:

        Paste the key value exactly as it was generated. Don’t append or insert any spaces, characters, or line breaks.

      4. Click Add.

        The SSH public key is added and appears in the list of SSH keys that you want to associate with the instance.

      Tip:

      The keys that you specify are stored as metadata on the instance. This metadata can be accessed from within the instance at http://192.0.0.192/{version}/meta-data/public-keys/{index}/openssh-key.
      • Oracle-provided images include a script that runs automatically when the instance starts, retrieves the keys, and adds them to the authorized_keys file of the opc user.

      • In images that you build, you can write and include a script that runs automatically when the instance starts, retrieves the SSH public keys, and adds the keys to the authorized_keys file of the appropriate users.

    • RDP: This field is displayed when you select a Windows image. Retain the default, Enabled, if you want to use RDP to access your Windows instance. If you select Disabled, you won’t be able to access your Windows instance using RDP.

    • Administrator Password: This field is displayed when you select a Windows image. The password displayed here is the password that you specified while getting the Windows image from Oracle Cloud Marketplace. You can retain this password, or specify a different password. You’ll use this password to log in to your Windows instance as the Administrator. Ensure that the password meets the Windows password complexity requirements. See the Windows Server documentation.

    • Custom Attributes: Enter any additional attributes that you want to store on the instance. This field allows you to customize your instance by providing additional information specific to each instance. You can enter arbitrary key-value pairs in plain text. The text you enter here must be in JSON format. This information is stored as user data on your instance.

      If you’re creating a Windows instance, the following required attributes are pre-populated for you.
      {
                "enable_rdp": true,
                "administrator_password": "Specify_password_here"
        }
      
      The Administrator password that appears here by default is the password that you specified when you selected the Windows image from Oracle Cloud Marketplace. You can specify a different Administrator password for your instance, if required. You can edit these attributes either directly in this field, or by modifying the RDP and Administrator Password fields above.

      On Oracle Linux instances created using Oracle-provided images with the release version 16.4.6 or later, the OPC Agent is installed and enabled by default. This agent collects and reports memory utilization metrics on your instance. If you want to disable this agent, enter the opc_guest_agent_enabled attribute set to false.

      For information about user-defined attributes that can be used to automate instance configuration, see Automating Instance Initialization Using opc-init.

      Note:

      Solaris machine images don’t include the opc-init scripts. So you can’t use opc-init to automate instance configuration of Solaris instances. (Not available on Oracle Cloud at Customer)

      After the instance is created, the attributes that you specify here are available within the instance at http://192.0.0.192/latest/user-data. For information about retrieving user data, see Retrieving User-Defined Instance Attributes.

  8. On the Network page, select or enter the required network settings, and then click the button to go to the next page:
    • DNS Hostname Prefix: (Optional) Specify a DNS host name prefix. The host name is visible internally within your DNS space. It is referenced by other instances in the domain, as well as by the OS and applications running on your instance. The host name that you specify is suffixed by the domain name. If you don’t specify a host name, then a host name is generated automatically.

    • Network Options: (Optional) From the 16.3.6 release onwards, Oracle-provided Oracle Linux and Windows machine images support up to eight interfaces (eth0 to eth7). If you use a private image, you can set up the image to support multiple interfaces. When you create an instance using these images, you can add each instance to up to eight different networks, including the shared network. To configure the shared network or IP networks, select the appropriate option.

      • (Available only on Oracle Cloud at Customer) If you select the IP Network option, you must click Configure Interface to configure IP network interfaces to enable access to your instance and specify one of the IP network interfaces as the default gateway for the instance. If you don’t click Configure Interface to specify an IP network, then the instance is added to the default security list in the shared network.

      • (Not available on Oracle Cloud at Customer) If you select the IP Network option, then the eth0 interface of the instance is added to the default IP network. You can accept the default values or if you want to specify the IP network options, from the menu icon menu, select Update.

        Click Configure Interface to configure the other network interfaces of the instance.

      • If you don't want to access the instance on the shared network, ensure that the Shared Network option is deselected. If you don’t select the Shared Network option, your instance isn’t added to the shared network.

      • If you don’t select the IP Network option, your instance isn’t added to any IP network. If you don’t select either option, your instance isn’t added to any IP network but it is added to the shared network. It is added to the default security list. This enables you to access the instance on the shared network after the instance is created. However, no public IP address is associated with it, so if you want to access the instance from the public Internet, you must first associate a public IP address with it. The shared network interface is automatically configured as the default gateway for the instance.

  9. IP Network Options
    Click Configure Interface. In the Configure IP Network Interface dialog box, enter the following information and then click Save.
    • Interface: Select the interface that you want to add to the IP network. After you select all the interfaces that you want to add to IP networks, the first available interface is assigned to the shared network. You can’t add, delete, or modify interface allocations after an instance is created.

    • vNIC Name: Retain the default vNIC name or enter another name. The three-part vNIC name is generated using this name. It has the format /Compute-identity_domain/username/instanceName_vnicName.

      If you enter a vNIC name, ensure that the name is unique to the site.

    • IP Network: Specify the IP network that you want to add this interface to. When you add an instance to an IP network, the specified interface of the instance is assigned an IP address on the specified IP network. After the instance is created, you can view information about each interface on the Instance Details page.

      If you haven’t created the IP network that you want to add your instance to, you can do so now. Click Create IP Network. Enter a name and the IP address prefix for the IP network, select an IP network exchange that you want to add the IP network to, if any. Then click Create. The IP network is created and selected in the list of IP networks that you want to add your instance to.

      If an IP network belongs to an IP network exchange and if you have specified a host name, then that host name is resolvable by all IP networks connected to the IP network exchange.

      The same DNS server will be used that is part of the IP network and will be setup by DHCP automatically.

    • Static IP Address: Specify a private IP address for this interface. The private IP address must be unused and it must belong to the subnet of the selected IP network. Remember, too, that certain IP addresses in a subnet are reserved. For example, the first unicast IP address of any IP network is reserved for the default gateway, the DHCP server, and the DNS server of that IP network.

      If no static IP address is specified, an IP address from the specified IP network is allocated dynamically, when the instance is created. Dynamically allocated IP addresses might change if the instance is deleted and re-created.

      Dynamic IP addresses are allocated from the lowest IP address in the range upwards. For example, if your IP network subnet is 192.168.1.0/25, dynamic allocation of IP addresses would start with 192.168.1.2 (as the first two IP addresses in the range, 192.168.1.0 and 192.168.1.1, are reserved).

      To ensure that a static IP address that you’ve specified isn’t already dynamically allocated, it is recommended that you specify static IP addresses from the end of your subnet range. For example, if your IP network subnet is 192.168.1.0/25, start allocating static IP addresses from 192.168.1.126 downwards (as the last IP address in the range, 192.168.1.127, is reserved).

    • Public IP Address: Select an available IP reservation for IP networks. When the instance is created, you can configure security rules and access control lists for your IP network to enable access to this IP address over the public Internet. If you don’t select an IP reservation now, you can associate a public IP address with this interface later by creating or updating an IP reservation.

    • Cloud IP Address: Select an available IP reservation from the cloud IP pool. When the instance is created, this IP address can be accessed by other Oracle Cloud services without being accessible over the public Internet. If you don’t select a cloud IP address now, you can associate a cloud IP address with this interface later by creating or updating an IP reservation.

    • MAC Address: Specify the MAC address of the interface, in hexadecimal format, where each digit is separated by colon. For example, you can enter 01:02:03:04:ab:cd as the MAC address but not 01-02-03-04-ab-cd. Ensure that the MAC addresses that you specify are unique within each IP network exchange and each IP network. If you specify a duplicate MAC address, each vNIC with that MAC address is disabled.

    • Virtual NIC Sets: Select the vNICsets that you want to add this interface to. Each interface is added to the default vNICset by default. If you select other vNICsets to add this interface to, you can remove it from the default vNICset. However, ensure that you add each interface to at least one vNICset, to enable communication to that interface. After the instance is created, communication with each vNIC depends on the vNICsets it belongs to and the access control lists that apply to each vNICset. While creating an instance, you can add a vNIC to up to 4 vNICsets. To add a vNIC to more than 4 vNICsets, update the required vNICsets after the instance is created. You can also remove vNICs from a vNICset after the instance is created.

    • DNS: Enter the DNS A record names for the instance. You can specify up to eight DNS A record names for each interface on an IP network. These names can be queried by instances on any IP network in the same IP network exchange. If no static IP address is specified for the interface, an IP address on the specified IP network is assigned automatically. After the instance is launched, the defined names are associated with the IP address that was automatically allocated to the interface.

    • Name Servers: Enter the name servers that are sent through DHCP as option 6. You can specify a maximum of eight name server IP addresses per interface.

    • Search Domains: Enter the search domains that should be sent through DHCP as option 119. You can enter a maximum of eight search domain zones per interface.

    • Default Gateway: Select this option if you want to use this interface as the default gateway. All network traffic uses the specified default gateway, unless a different interface is explicitly configured for an application within the instance.

  10. Shared Network Options
    • Public IP Address:
      • If you want to connect to this instance over the Internet, then select either Auto Generated or Persistent Public IP Reservation.

      • If you select an autogenerated public IP address, the IP address persists while the instance is running, but will change if you delete the instance and create it again later.

      • To associate a permanent public IP address with the instance, select Persistent Public IP Reservation.

      • If you’ve already created an IP address reservation, select it from the list. Otherwise, to create one now, click Create IP Reservation. In the Create Public IP Reservation dialog box, enter a name for the IP reservation and then click Create. The IP reservation is created. Select this IP reservation from the list of persistent public IP reservations.

      • If you don’t want your instance to be accessed over the Internet, then you don’t need to associate a public IP address with it. In the Public IP Address list, select None.

      For more information about public IP addresses, see About Public IP Addresses.

    • Security Lists:
      • (Optional) Specify the security lists that you want to add the instance to. Click this field or start typing to see a list of available security lists. When you add an instance to a security list, you can control access to or from this instance by creating security rules that use the specified security list as a source or destination.

      • (Optional) If you haven’t created the security lists that you want to use, you can do so now. Click Create Security List. Enter a name for the security list and optionally enter a description, and then click Create. The security list is created and appears in the list of security lists that you want to add your instance to.

      If you don’t specify any security list, the instance is added to the default security list, default/default. You can use this security list as a source or destination in security rules that you create. If any existing security rules already specify this security list as a source or destination, those rules will apply to this instance when the instance is created. If you don’t want to use those security rules with this instance, or if you want to configure access to this instance separately later on, remember to remove the instance from the default/default security list after it is created. See Removing an Instance from a Security List.

      For more information about security lists, see About Security Lists.

  11. The Storage page shows the persistent boot disk that will be created and used to boot your instance. You can retain this setting and attach additional storage volumes later, when the instance is running. Alternatively, you can update or remove the persistent boot disk that is created by default or attach additional boot or data disks now.

    You can attach existing storage volumes to your instance, if required, or create storage volumes and attach them to the instance.

    • To attach storage volumes that you’ve already created:

      Click Attach Existing Volume.

      Note:

      You can’t detach storage volumes that are attached during instance creation.

      In the Attach Existing Storage Volume dialog box, select or enter the following and then click Add:

      • Attach Storage Volume: Select the storage volume that you want to attach.

        Note:

        A storage volume must be in the online state before it can be attached to an instance. If a storage volume is already attached to another instance or if it is in an error state, it’s not displayed in the Attach Storage Volume list.

      • Attach as Disk #: Enter a disk index number. The disk number that you specify here determines the device name. The disk attached at index 1 is named /dev/xvdb, the disk at index 2 is /dev/xvdc, the disk at index 3 is /dev/xvdd, and so on. Make a note of the disk number. You’ll need it later when you mount the storage volume on the instance.

      • Boot Drive: Select this option to use the specified storage volume as the boot disk. The storage volume you select here must have the same image as the image that you selected on the Image page of the Create Instance wizard.

    • To create a storage volume and attach it to the instance:

      Click Add New Volume.

      In the Add New Storage Volume dialog box, select or enter the following and then click Add:

      • Name: Enter a name for this storage volume.

      • Size: The size is set automatically to accommodate the disk size that’s specified in the image that you selected earlier. If you want a larger boot disk than that specified in the image, then enter a larger size.

        Note:

        You can increase the size of a storage volume after creating it, even if the storage volume is attached to an instance. See Increasing the Size of a Storage Volume. However, you can’t reduce the size of a storage volume after you’ve created it. So ensure that you don’t overestimate your storage requirement.

      • Storage Property: Select a storage property.

        Based on your latency and IOPS requirements, select one of the following storage properties.
        Storage Property Latency Throughput
        storage/default Standard Standard
        storage/latency Low High
        storage/ssd/gpl Lowest Highest

        Note:

        SSD storage volumes aren’t available in all sites.

        The web console might show other storage properties. Don’t select any of them.

      • Description: (Optional) Enter a description.

      • Attach as Disk #: Accept the default disk number or enter a higher number. The disk number that you specify here determines the device name. The disk attached at index 1 is named /dev/xvdb, the disk at index 2 is /dev/xvdc, the disk at index 3 is /dev/xvdd, and so on.Make a note of the disk number. You’ll need it later when you mount the storage volume on the instance.

      • Boot Drive: Select this option to use the specified storage volume as the boot disk. When you select this option, the disk number is automatically set to 1.

    • To customize the persistent boot disk that is created by default:

      From the menu icon menu, select Update. In the Update Storage Volume dialog box, you can modify the disk size, storage property, or the description. You can also uncheck the Boot Drive option. The persistent storage volume will still be created when the instance is created, but it won’t be used to boot the instance. Instead, a nonpersistent boot disk will be created and used to boot the instance.

    • To create an instance that uses a nonpersistent boot disk:

      Remove the default boot disk. From the menu icon menu, select Remove. When you do this and you don’t specify another persistent storage volume as the boot drive, a nonpersistent boot disk is used to boot your instance.

      Note:

      If you want to create an instance snapshot to use this instance as a template for creating other instances, remove the persistent boot disk while creating this instance and use a nonpersistent boot disk instead. You can’t create an instance snapshot of an instance that uses a persistent boot disk.

      However, if you want to use a persistent boot disk to boot your instance, you can still use this boot disk as a template to create other instances by creating a storage volume snapshot of the boot disk and using that snapshot to create a new bootable storage volume. See Backing Up and Restoring Storage Volumes Using Snapshots.

    When you’re done, click the button to go to the next page.
  12. On the Review page, verify the information that you’ve entered, and then click Create.
  13. Monitor the status of the instance.
    • When you create an instance, the initial status is Preparing. Compute Classic allocates resources and prepares to create the instance.

    • While the specified image is being installed, the state changes to Initializing.

    • After the image is installed and the instance is starting, the status changes to Starting.

    • When the instance is ready, the status changes to Running. When an instance is in the Running state, you can connect to it. You can also attach or detach storage volumes and security lists.

    • When an instance is running, you can shut down the instance. Its status changes to Stopping. When the operation is completed, its status changes to Stopped. When an instance is shut down or stopped, you can either start the instance, or delete it.

    • When an instance is running or shut down, you can delete the instance. Its status changes to Deleting. When the operation is completed, the instance is deleted.

    • At times, an instance can have the Error status.

      For example, when you create or re-create an instance by starting its orchestration, if some of the resources required to create the instance aren’t available, then the status of the instance changes to Error.

    Note:

    If you get an error message Unable to place instance... it indicates that the site you’ve selected doesn’t have sufficient resources to create this instance. If your domain spans multiple sites, then use the Site menu near the top of the page to select another site and run the Create Instance wizard again.

After your instance is created, you can log in to your instance. See Logging In to an Instance.

Tip:

To ensure that Compute Classic instances provide a resilient platform for your workloads, make sure that the latest security patches are applied to the operating system running on the instances. In addition, before deploying applications on an instance, review the security configuration of the operating system and verify that it complies with your security policies and standards.

For security and patching-related guidelines, see the documentation for your operating system.