oracle / oci-cli

Command Line Interface for Oracle Cloud Infrastructure
https://cloud.oracle.com/cloud-infrastructure
Other
452 stars 186 forks source link

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

Open dch opened 2 weeks ago

dch commented 2 weeks ago

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

These are effectively tarballs containing:

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.

NupurGupta3101 commented 2 weeks ago

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

dch commented 2 weeks ago
$ 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 commented 2 weeks ago

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.