Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The onevrouter instantiate command may ask for user input for no reason #6948

Open
3 tasks
sk4zuzu opened this issue Feb 24, 2025 · 0 comments
Open
3 tasks

Comments

@sk4zuzu
Copy link
Contributor

sk4zuzu commented Feb 24, 2025

Description
When using VR/instance template that contains non-empty USER_INPUTS=[] vector (for example downloaded directly from marketplace) with the onevrouter instantiate CLI command, the CLI itself always asks for all inputs regardless if some of them are already provided, then when entered by the user the values seem to be actually ignored.

To Reproduce
This snippet should illustrate the problem:

oneimage create -d default --name vr1 --prefix vd --path https://marketplace.opennebula.io//appliance/cc96d537-f6c7-499f-83f1-15ac4058750e/download/0

onetemplate create <<'EOF'
NAME = "vr1"
CONTEXT=[
  NETWORK="YES",
  ONEAPP_VNF_NAT4_ENABLED="$ONEAPP_VNF_NAT4_ENABLED",
  ONEAPP_VNF_NAT4_INTERFACES_OUT="$ONEAPP_VNF_NAT4_INTERFACES_OUT",
  SSH_PUBLIC_KEY="$USER[SSH_PUBLIC_KEY]",
  TOKEN="YES" ]
CPU="1"
DISK=[
  IMAGE="vr1" ]
GRAPHICS=[
  LISTEN="0.0.0.0",
  TYPE="vnc" ]
INPUTS_ORDER="ONEAPP_VNF_NAT4_ENABLED,ONEAPP_VNF_NAT4_INTERFACES_OUT"
LXD_SECURITY_PRIVILEGED="true"
MEMORY="512"
NIC_DEFAULT=[
  MODEL="virtio" ]
OS=[
  ARCH="x86_64" ]
USER_INPUTS=[
  ONEAPP_VNF_NAT4_ENABLED="O|boolean|Enable NAT| |NO",
  ONEAPP_VNF_NAT4_INTERFACES_OUT="O|text|NAT - Outgoing Interfaces" ]
VROUTER="YES"
EOF

onevrouter create <<'EOF'
NAME="vr1"
NIC=[
  NETWORK="service",
  FLOATING_IP="YES",
  FLOATING_ONLY="YES" ]
NIC=[
  NETWORK="private",
  FLOATING_IP="YES",
  FLOATING_ONLY="NO" ]
EOF

EXTRA_CONTEXT='ONEAPP_VNF_NAT4_ENABLED="YES",ONEAPP_VNF_NAT4_INTERFACES_OUT="eth0"'

onevrouter instantiate vr1 vr1 --multiple 2 --context "$EXTRA_CONTEXT"

The result is

ID: 139
ID: 63
ID: 41
There are some parameters that require user input. Use the string <<EDITOR>> to launch an editor (e.g. for multi-line inputs)
  * (ONEAPP_VNF_NAT4_ENABLED) Enable NAT
    Press enter for default (NO).
  * (ONEAPP_VNF_NAT4_INTERFACES_OUT) NAT - Outgoing Interfaces

Expected behavior
CLI interface should NOT ask for user inputs if user already provided them by some other supported way (like --context option).

Details

  • Affected Component: CLI
  • Hypervisor: N/A
  • Version: 6.10.2 (but most likely all recent releases)

Additional context
🐈 + 🥒

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
@jaimecb jaimecb self-assigned this Feb 24, 2025
jaimecb added a commit to jaimecb/docs that referenced this issue Feb 27, 2025
Signed-off-by: Jaime Conchello <jconchello@opennebula.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants