oci-cli icon indicating copy to clipboard operation
oci-cli copied to clipboard

Clarify how to customize launch options when importing a custom image

Open ilian opened this issue 4 years ago • 3 comments

Hi.

It is not clear how to provide launch options (e.g. specify firmware type) when importing a custom image from block storage with oci compute image import.

The manpage of that command contains the following information:

       --launch-mode [text]

       Specifies the configuration mode for  launching  virtual  machine  (VM)
       instances.  The configuration modes are: * NATIVE - VM instances launch
       with paravirtualized boot and  VFIO  devices.  The  default  value  for
       platform  images.  *  EMULATED  -  VM  instances  launch  with emulated
       devices, such as the  E1000  network  driver  and  emulated  SCSI  disk
       controller.    *   PARAVIRTUALIZED   -   VM   instances   launch   with
       paravirtualized devices using VirtIO drivers. * CUSTOM -  VM  instances
       launch   with   custom   configuration   settings   specified   in  the
       LaunchOptions parameter.

Is it possible to provide a LaunchOptions parameter using oci-cli? If so, would it be possible to add some more clarifications to the manpage on how to achieve it?

Many thanks.

ilian avatar May 29 '21 14:05 ilian

same here.

Needing to modify the shape compatbility & image type again after import is very annoying.

$ oci compute image import from-object \
  --bucket-name images \
  --compartment-id $OCI_CID \
  --namespace $OCI_NS \
  --operating-system $OS_TYPE \
  --operating-system-version $OS_VERSION \
  --source-image-type QCOW2 \
  --display-name $IMAGE \
  --name $IMAGE

produces the JSON response body:

{
  "data": [
    {
      "agent-features": null,
      "base-image-id": null,
      "billable-size-in-gbs": 0,
      "compartment-id": "ocid1.tenancy.oc1..aaaaabbcc123",
      "create-image-allowed": true,
      "defined-tags": {
        "Oracle-Tags": {
          "CreatedBy": "dch@",
          "CreatedOn": "2022-04-..."
        }
      },
      "display-name": "arm64-aarch64-20220404-c78d300e1b639ed1a2dc7035a8acecf10ceb0a9b.qcow2",
      "freeform-tags": {},
      "id": "ocid1.image.oc1.eu-amsterdam-1.aaaabbcc123",
      "launch-mode": "NATIVE",
      "launch-options": {
        "boot-volume-type": "ISCSI",
        "firmware": "UEFI_64",
        "is-consistent-volume-naming-enabled": false,
        "is-pv-encryption-in-transit-enabled": false,
        "network-type": "VFIO",
        "remote-data-volume-type": "PARAVIRTUALIZED"
      },
      "lifecycle-state": "IMPORTING",
      "listing-type": null,
      "operating-system": "...",
      "operating-system-version": "...",
      "size-in-mbs": null,
      "time-created": "2022-04-04T21:52:50.751000+00:00"
    }
  ]
}

I'd like to see a --launch-options file:///path/to/some.json here.

dch avatar Apr 04 '22 21:04 dch

Image Launch Options are not able to be changed and are the default if no image capabilities are present. Image capabilities supersede launch options and more details can be found here. https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/configuringimagecapabilities.htm

I will see about getting documentation in the man pages here for this though I agree that it's not exactly obvious.

ICTKevinWong avatar May 02 '23 18:05 ICTKevinWong