Custom Images - TypeError: Unrecognized keyword arguments: launch_options
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Inizia esaminando il modello CreateImageDetails installato e il percorso del costruttore mostrato in oci/decorators.py, quindi confronta i campi accettati con la documentazione dell'API CreateImageDetails. Verifica se launch_options manca nella versione dell'SDK e se il problema viene risolto tramite un utilizzo supportato o un aggiornamento del modello.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 474
- Fork
- 321
- Merge medio
- 23m
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di oracle/oci-python-sdk
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
oracle/oci-python-sdk#890 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
oracle/oci-python-sdk#879 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
oracle/oci-python-sdk#878 ·
-
SDK
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
oracle/oci-python-sdk#852 ·
-
SDK
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
oracle/oci-python-sdk#836 · 1 reazione ·
Tutte le issue di oracle/oci-python-sdk
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·