Oracle Cloud Infrastructure Documentation

Importing Custom Windows Images

The Compute service enables you to import Windows images that were created outside of Oracle Cloud Infrastructure. For example, you can import images running on your on-premises physical or virtual machines (VMs), or VMs running in Oracle Cloud Infrastructure Classic. You can then launch your imported images on Compute virtual machines.

Note

Imported images are not supported on AMD shapes.

Warning

Avoid entering confidential information when assigning descriptions, tags, or friendly names to your cloud resources through the Oracle Cloud Infrastructure Console, API, or CLI.

Supported Operating Systems

These Windows versions support custom image import:

  • Windows Server 2008 R2 Standard, Enterprise, Datacenter
  • Windows Server 2012 Standard, Datacenter
  • Windows Server 2012 R2 Standard, Datacenter
  • Windows Server 2016 Standard, Datacenter
  • Windows Server 2019 Standard, Datacenter
    Note

  • Oracle Cloud Infrastructure has tested the operating systems listed previously and will support customers in ensuring that instances launched from these images and built according to the guidelines in this topic are accessible using RDP.
  • For OS editions not listed previously, Oracle Cloud Infrastructure will provide commercially reasonable support to customers in an effort to get instances that are launched from these images accessible via RDP.
  • Support from Oracle Cloud Infrastructure in launching an instance from a custom OS does not ensure that the operating system vendor also supports the instance.
  • Oracle Cloud Infrastructure licenses and charges the Windows licensing fee for all instances launched using an imported Windows OS image. This applies whether or not those instances are registered with Oracle Cloud Infrastructure's Microsoft Key Management service.

Windows Source Image Requirements

Custom images must meet the following requirements:

  • The maximum image size is 300 GB.

  • The image must be set up for BIOS boot.

  • Only one disk is supported, and it must be the boot drive with a valid master boot record (MBR) and boot loader. You can migrate additional data volumes after you import the image's boot volume.

  • The boot process must not require additional data volumes to be present for a successful boot.

  • The disk image cannot be encrypted.

  • The disk image must be a VMDK or QCOW2 file.

    • Create the image file by cloning the source volume, not by creating a snapshot.
    • VMDK files must be either the "single growable" (monolithicSparse) type or the "stream optimized" (streamOptimized) type, both of which consist of a single VMDK file. All other VMDK formats, such as those that use multiple files, split volumes, or contain snapshots, are not supported.
  • The network interface must use DHCP to discover the network settings. When you import a custom image, existing network interfaces are not recreated. Any existing network interfaces are replaced with a single NIC after the import process is complete. You can attach additional VNICs after you launch the imported instance.

  • The network configuration must not hardcode the MAC address for the network interface.

Preparing Windows VMs for Import

Before you can import a custom Windows image, you must prepare the image to ensure that instances launched from the image can boot correctly and that network connections will work.

You can perform the tasks described in this section on the running source system. If you have concerns about modifying the live source system, you can export the image as-is, import it into Oracle Cloud Infrastructure, and then launch an instance based on the custom image. You can then connect to the instance using the VNC console and perform the preparation steps.

Important

The system drive where Windows is installed will be imported to Oracle Cloud Infrastructure. All partitions on the drive will follow through the imported image. Any other drives will not be imported and you must re-create them on the instance after import. You will then need to manually move the data on the non-system drives.

To prepare a Windows VM for import:

  1. Follow your organization's security guidelines to ensure that the Windows system is secured. This can include, but is not limited to the following tasks:

    • Install the latest security updates for the operating system and installed applications.

    • Enable the firewall, and configure it so that you only enable the rules which are needed.

    • Disable unnecessary privileged accounts.

    • Use strong passwords for all accounts.

  2. Configure Remote Desktop Protocol (RDP) access to the image:

    1. Enable Remote Desktop connections to the image.
    2. Modify the Windows Firewall inbound port rule to allow RDP access for both Private and Public network location types. When you import the image, the Windows Network Location Awareness service will identify the network connection as a Public network type.
  3. Determine whether the current Windows license type is a volume license by running the following command in PowerShell:

    Get-CimInstance -ClassName SoftwareLicensingProduct | where {$_.PartialProductKey} | select ProductKeyChannel

    If the license is not a volume license, after you import the image, you will update the license type.

  4. If you plan to launch the imported image on more than one VM instance, create a generalized image of the boot disk. A generalized image is cleaned of computer-specific information, such as unique identifiers. When you create instances from a generalized image, the unique identifiers are regenerated. This prevents two instances that are created from the same image from colliding on the same identifiers.

  5. Create a backup of the root volume.

  6. If the VM has remotely attached storage, such as NFS or block volumes, configure any services that rely on this storage to start manually. Remotely attached storage is not available the first time that an imported instance boots on Oracle Cloud Infrastructure.

  7. Ensure that all network interfaces use DHCP, and that the MAC address and IP addresses are not hardcoded. See your system documentation for steps to perform network configuration for your system.

  8. Download the Oracle Windows VirtIO drivers:

    1. Log in to the Oracle Software Delivery Cloud site.
    2. In the All Categories list, select Release.
    3. Type Oracle Linux 7.6 in the search box and click Search.
    4. Add REL: Oracle Linux 7.6.x to your cart, and then click Checkout.
    5. In the Platforms/Languages list, select x86 64 bit. Click Continue.
    6. Accept the license agreement and then click Continue.
    7. Select the check box next to Oracle VirtIO Drivers Version for Microsoft Windows 1.1.4. Clear the other check boxes.
    8. Click Download and then follow the prompts.
  9. Install the Oracle VirtIO drivers for Windows:

    1. Follow the prompts in the installation wizard. On the Installation Type page, select Custom, as shown in the following screenshot.

      This screenshot shows the Oracle VirtIO installation wizard with the Custom installation type selected.

    2. Reboot the VM.

  10. Stop the VM.

  11. Clone the stopped VM as a VMDK or QCOW2 file, and then export the image from your virtualization environment. See the tools documentation for your virtualization environment for steps.

Importing a Windows-Based VM

After you prepare a Windows image for import, follow these steps to import the image:

  1. Upload the VMDK or QCOW2 file to Oracle Cloud Infrastructure:

    1. Upload the file to an Object Storage bucket. You can upload the file using the Console or using the command line interface (CLI). If you use the CLI, use the following command:

      oci os object put -bn <destination_bucket_name> --file <path_to_the_VMDK_or_QCOW2_file>
    2. Copy the URL of the file that you uploaded: On the Bucket Details page, click the the Actions icon (three dots) next to the file, and then click Details. Copy the URL Path (URI).
  2. Open the navigation menu. Under Core Infrastructure, go to Compute and click Custom Images.

  3. Click Import Image.

  4. In the Create in Compartment list, select the compartment that you want to import the image to.

  5. Enter a name for the image.

  6. For the Operating System, select Windows.

  7. In the Operating System Version list, select the version of Windows.

  8. Confirm that you chose the operating system version that complies with your Microsoft licensing agreement, and then select the compliance check box.

    Important

    Failure to provide the correct version and SKU information could be a violation of your Microsoft Licensing Agreement.

  9. In the Object Storage URL field, paste the URL of the file that you uploaded.

  10. For the Image Type, select the file type of the image, either VMDK or QCOW2.

  11. In the Launch Mode area, select Paravirtualized Mode.

  12. Tags: Optionally, you can apply tags. If you have permissions to create a resource, you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you are not sure if you should apply tags, skip this option (you can apply tags later) or ask your administrator.
  13. Click Import Image.

    The imported image appears in the Custom Images list for the compartment, with a status of IMPORTING. When the import completes successfully, the status changes to AVAILABLE.

    If the status doesn't change, or no entry appears in the Custom Images list, the import failed. Ensure that you have read access to the Object Storage object, and that the object contains a supported image.

  14. Complete the post-import tasks.

Post-Import Tasks for Windows Images

After you import a custom Windows-based image, do the following:

  1. Create an instance based on the custom image. For the image source, select Custom Images, and then select the image that you imported.

  2. Enable Remote Desktop Protocol (RDP) access to the Compute instance.
  3. Connect to the instance using RDP.
  4. If the instance requires any remotely attached storage, such as block volumes or file storage, create and attach it.
  5. Create and attach any required secondary VNICs.
  6. Test that all applications are working as expected.
  7. Reset any services that were set to start manually.
  8. Register the instance with the Oracle-provided Key Management Service (KMS) server:

    1. On the instance, open PowerShell as Administrator.
    2. To set the KMS endpoint, run the following command:

      slmgr /skms 169.254.169.253:1688
    3. If the Windows license type that you noted while preparing the image isn't a volume license, you must update the license type. Run the following command:

      slmgr /ipk <setup key>

      <setup key> is the KMS client setup key that corresponds to the version of Windows that you imported:

      Windows Version KMS Client Setup Key
      Windows Server 2008 R2 Standard YC6KT-GKW9T-YTKYR-T4X34-R7VHC
      Windows Server 2008 R2 Enterprise 489J6-VHDMP-X63PK-3K798-CPX3Y
      Windows Server 2008 R2 Datacenter 74YFP-3QFB3-KQT8W-PMXWJ-7M648
      Windows Server 2012 Standard XC9B7-NBPP2-83J2H-RHMBY-92BT4
      Windows Server 2012 Datacenter 48HP8-DN98B-MYWDG-T2DCC-8W83P
      Windows Server 2012 R2 Standard D2N9P-3P6X9-2R39C-7RTCD-MDVJX
      Windows Server 2012 R2 Datacenter W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9
      Windows Server 2016 Standard WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY
      Windows Server 2016 Datacenter CB7KF-BWN84-R7R2Y-793K2-8XDDG
      Windows Server 2019 Standard N69G4-B89J2-4G8F4-WWYCC-J464C
      Windows Server 2019 Datacenter WMDGN-G9PQG-XVVXX-R3X43-63DFG
    4. To activate Windows, run the following command:

      slmgr /ato
    5. To verify the license status, run the following command:

      Get-CimInstance -ClassName SoftwareLicensingProduct | where {$_.PartialProductKey} | select Description, LicenseStatus

      If the LicenseStatus is 1, the instance is properly licensed. It might take up to 48 hours for the license status to update.

This topic has moved. Please update your bookmarks.