Repository navigation
Custom Images - TypeError: Unrecognized keyword arguments: launch_options #861
Copy link
Copy link
Open
Labels
SDKIssue pertains to the SDK itself and not specific to any serviceIssue pertains to the SDK itself and not specific to any service
Description
Im trying to create a Custom Image from an object in a specific bucket, with custom Launch Options.
Based on the link https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/datatypes/CreateImageDetails we should be able to use LaunchOptions, but I cant find any way to use them. How and where should we use "LaunchOptions"?
Below there is the configuration/code.
> pip3 show oci
Name: oci
Version: 2.171.0
Summary: Oracle Cloud Infrastructure Python SDK
Home-page: https://docs.oracle.com/en-us/iaas/tools/python/latest/index.html
Author: Oracle
Author-email: joe.levy@oracle.com
License: Universal Permissive License 1.0 or Apache License 2.0
Requires: certifi, circuitbreaker, cryptography, pyOpenSSL, python-dateutil, pytz, urllib3
> python3 --version
Python 3.11.2
This is my python3 code:
import oci
import os
import json
oci_config_file="./oci_config"
the_profile_name=oci.config.DEFAULT_PROFILE or "DEFAULT"
the_namespace="MyNamespace"
bucket_name="MyBucket"
object_name="debian-13-genericcloud-amd64-20260413-2447.qcow2"
qcow2folder='./qcow2/13-trixie/20260413-2447'
metadata_json_file = os.path.join(qcow2folder, f"{os.path.splitext(object_name)[0]}_python.json")
with open(metadata_json_file, "r") as meta_file:
metadata_json = json.load(meta_file)
config = oci.config.from_file(file_location=oci_config_file, profile_name=the_profile_name)
compute_client = oci.core.ComputeClient(config)
object_display_name=os.path.splitext(os.path.basename(object_name))[0]
# https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/datatypes/LaunchOptions
launch_options = oci.core.models.LaunchOptions(
boot_volume_type="PARAVIRTUALIZED",
firmware="UEFI_64",
is_consistent_volume_naming_enabled=False,
is_pv_encryption_in_transit_enabled=True,
network_type="PARAVIRTUALIZED",
remote_data_volume_type="PARAVIRTUALIZED"
)
# https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/datatypes/ImageSourceViaObjectStorageTupleDetails
image_source_details=oci.core.models.ImageSourceViaObjectStorageTupleDetails(
source_type="objectStorageTuple",
bucket_name=bucket_name,
namespace_name=the_namespace,
object_name=object_name,
operating_system="Debian",
operating_system_version="20260413-2447",
source_image_type="QCOW2"
)
# https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/datatypes/CreateImageDetails
create_image_details=oci.core.models.CreateImageDetails(
compartment_id=config['tenancy'],
display_name=object_display_name,
freeform_tags=metadata_json,
image_source_details=image_source_details,
launch_mode="CUSTOM",
launch_options=launch_options
)
But what I get is:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "./venv/lib/python3.11/site-packages/oci/decorators.py", line 25, in init
raise TypeError('Unrecognized keyword arguments: {}'.format(', '.join(six.iterkeys(kwargs))))
TypeError: Unrecognized keyword arguments: launch_options
Metadata
Metadata
Assignees
Labels
SDKIssue pertains to the SDK itself and not specific to any serviceIssue pertains to the SDK itself and not specific to any service
Activity
PechimuthuMithil commentedon Apr 21, 2026
Hello @DoctorD90 !
Based on these docs, I see that
CreateImageDetailsdoes't support thelaunch_optionargument.These docs might be stale
DoctorD90 commentedon Apr 21, 2026
Thanks @PechimuthuMithil ! Exactly, I read
* CUSTOM - VM instances launch with custom configuration settings specified in the LaunchOptions parameter.And from the "Interface" of the Custom Image creation seems possible to configure, during or after the creation.
Im in doubt if is in the code a lil missing of "LaunchOptions" or the documentation is not updated with the "correct flow", but than some configurations wouldn't be possible. I dont know how to manage it 🤔
DoctorD90 commentedon May 12, 2026
At current state of art, Im not able to configure those variables, I have to manually go on the web, and use it; it seems no possible to completely automate the release/deploy of a VM from a custom images
PechimuthuMithil commentedon May 13, 2026
Hello @DoctorD90 !
I will reach out to the Compute service team to clarify this. I also see that
lauch_optionsis not a valid parameter forCreateImageDetails.Thank you!
DoctorD90 commentedon May 13, 2026
Thank you VERY much @PechimuthuMithil ! I will wait for update 😊 (happy at least that this time it is an useful Issue and I have read all the documentation about the topic hehe)