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

web UI supports importing OCI-format images but oci-cli does not

Open dch opened this issue 1 year ago • 3 comments

In the below example you can see how the web UI supports importing OCI-format images.

These are effectively tarballs containing:

  • image_metadata.json containing various useful metadata
  • output.QCOW2 the actual image as a qcow format disk

20241108-155202

But this is not possible in the CLI - only VMDK and QCOW2 formats are supported. Can we have this added please, along with some improved docs on how to use this?

Having this functionality exposed in the CLI makes it much easier to upload images, and the metadata file already contains settings, so we don't need to make additional API calls to modify it again later.

dch avatar Nov 08 '24 15:11 dch

Can you please share the full command which you are trying.

NupurGupta3101 avatar Nov 12 '24 13:11 NupurGupta3101

$ oci compute image import from-object \
  --region us-ashburn-1 \
  --namespace ... \
  --bucket-name ... \
  --compartment-id ocid1.tenancy.oc1..... \
  --name FreeBSD-14.2-STABLE-amd64-amd64-20241108-ce988aa3e800-ufs.oci \
  --display-name FreeBSD-14.2-STABLE-amd64-amd64-20241108-ce988aa3e800-ufs \
  --launch-mode PARAVIRTUALIZED \
  --operating-system FreeBSD \
  --operating-system-version FreeBSD-14.2-STABLE-amd64-amd64-20241108-ce988aa3e800-ufs \
  --source-image-type OCI  <----------- this is the problem

Usage: oci compute image import from-object [OPTIONS]

Error: Invalid value for '--source-image-type': invalid choice: OCI. (choose from QCOW2, VMDK)

For OCI CLI commands and parameters suggestion, auto completion and other useful features, try the Interactive mode by typing `oci -i`.

dch avatar Nov 12 '24 18:11 dch

Actually the main reason we're interested in this, is that the OCI bundle includes metadata about the shape compatibility. If its possible to provide that at import time via another parameter, that would also be fine.

dch avatar Nov 12 '24 18:11 dch