Creating a new required gnt-instance cli option

18 views
Skip to first unread message

Unavailable Now

unread,
Jan 4, 2023, 4:20:42 AM1/4/23
to ganeti
Hello,

I would like to create a new gnt-instance cli option and patch it in our installation. Let's say a ticket number is required when ever adding a new instance to the cluster with minimum requirements:

* a required option when adding a new instance
* it can be seen in gnt-instance info
* it cannot be modified
* it must be provided when reinstalling
* keep it when moving the instance or migrating

I am not a python expert, but I can navigate through the code. I hope I can get a hint if it is possible within the python code and how to approach it. For now I am struggling with the first two points. In cli.py and cli_opts.py I can add my option and make it required, but I am not getting further, I could track the error to cli.py line 1255, then SubmitOrSend -> SubmitOpCode -> SetGenericOpcodeOpts and finally _InitReasonTrail
I have an issue with the slots, when ever I add my new variable to opcodes.py to the:
class OpInstanceCreate(OpCode), I get the error:
---------------------------------------------------------------------
Unhandled protocol error while talking to the master daemon:
Failed to parse request: SubmitJob: Superfluous dictionary keys: ["ticket"], but only ["OP_ID","beparams","comment","commit","compress","conflicts_check","debug_level","depends","disk_template","disks","dry_run","file_driver","file_storage_dir","force_variant","forthcoming","group_name","helper_shutdown_timeout","helper_startup_timeout","hvparams","hypervisor","iallocator","identify_defaults","ignore_ipolicy","instance_communication","instance_name","ip_check","mode","name_check","nics","no_install","opportunistic_locking","os_type","osparams","osparams_private","osparams_secret","pnode","pnode_uuid","priority","reason","snode","snode_uuid","source_handshake","source_instance_name","source_shutdown_timeout","source_x509_ca","src_node","src_node_uuid","src_path","start","tags","wait_for_sync"] allowed.
-----------------------------------------------------------------------------------

It would be great to know what is going wrong and if I can solve it and how.

Best regards
Max

Unavailable Now

unread,
Jan 25, 2023, 4:27:23 AM1/25/23
to ganeti
I added the new required cli argument and mapped it to the tags.
Reply all
Reply to author
Forward
0 new messages