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

Template context variables delete on instantiation #4409

Closed
7 tasks
OpenNebulaSupport opened this issue Mar 24, 2020 · 2 comments
Closed
7 tasks

Template context variables delete on instantiation #4409

OpenNebulaSupport opened this issue Mar 24, 2020 · 2 comments

Comments

@OpenNebulaSupport
Copy link
Collaborator

Description
On Virtual Machine Template instantiation, the value of context variables set from NIC -like $NIC[VIRTIO_QUEUES]- are deleted. Also, if several USER_INPUTS present, at least one of them is removed from context.

To Reproduce
Having a Virtual Network defined as follows -with attribute VIRTIO_QUEUES="8"-:

BRIDGE="br1"
BRIDGE_TYPE="linux"
GATEWAY="10.10.100.1"
NETWORK_ADDRESS="10.10.100.0"
NETWORK_MASK="255.255.255.0"
OUTER_VLAN_ID=""
PHYDEV=""
VIRTIO_QUEUES="8"
VLAN_ID=""
VN_MAD="bridge"

And a Virtual Machine Template defined as follows:

CONTEXT=[
  NETWORK="YES",
  SSH_PUBLIC_KEY="$USER[SSH_PUBLIC_KEY]",
  USER_INPUT1="$USER_INPUT1",
  USER_INPUT2="$USER_INPUT2",
  VIRTIO_QUEUES="$NIC[VIRTIO_QUEUES]" ]
CPU="1"
DISK=[
  IMAGE="Alpine Linux 3.11",
  IMAGE_UNAME="oneadmin" ]
GRAPHICS=[
  LISTEN="0.0.0.0",
  TYPE="VNC" ]
INPUTS_ORDER="USER_INPUT1,USER_INPUT2,USER_INPUT3"
MEMORY="128"
MEMORY_UNIT_COST="MB"
NIC=[
  NETWORK="mynet",
  NETWORK_MODE="auto",
  NETWORK_UNAME="oneadmin",
  SCHED_REQUIREMENTS="ID=\"4\"",
  VIRTIO_QUEUES="8" ]
NIC_DEFAULT=[
  MODEL="virtio",
  VIRTIO_QUEUES="8" ]
OS=[
  BOOT="" ]
USER_INPUTS=[
  USER_INPUT1="M|text|input1",
  USER_INPUT2="M|text|input2",
  USER_INPUT3="M|text|input3" ]
VCPU="1"
  • On instantiation from Sunstone: value of VIRTIO_QUEUES is deleted and USER_INPUT3 variable is not present.
CONTEXT=[
  DISK_ID="1",
...
  TARGET="hda",
  USER_INPUT1="one",
  USER_INPUT2="two",
  VIRTIO_QUEUES="" ]

Log output:

Tue Mar 24 13:03:47 2020 [Z0][ReM][D]: Req:528 UID:0 IP:127.0.0.1 one.template.instantiate invoked , 3, "", false, "USER_INPUT1="one"
USER_INPUT2="two"
USER_INPUT3="three"
DISK=[
  IMAGE="Alpine Linux 3.11",
  IMAGE_UNAME="oneadmin",
  SIZE="256"
]

NIC=[
  NETWORK_MODE="auto",
  SCHED_REQUIREMENTS="ID=\"4\""
]

MEMORY="128"
CPU="1"
VCPU="1"
NIC_ALIAS = []
SCHED_REQUIREMENTS = []
SCHED_DS_REQUIREMENTS = []", false
  • On instantiation from CLI: USER_INPUT3 variable is not present.
CONTEXT=[
  DISK_ID="1",
...
  TARGET="hda",
  USER_INPUT1="aaa",
  USER_INPUT2="bbb",
  VIRTIO_QUEUES="8" ]

Log output:

Tue Mar 24 13:12:04 2020 [Z0][ReM][D]: Req:608 UID:0 IP:127.0.0.1 one.template.instantiate invoked , 3, "", false, "USER_INPUT1 = "aaa"
USER_INPUT2 = "bbb"
USER_INPUT3 = "ccc"", false

Expected behavior
On instantiation all context variables and their values must be present.

Details

  • Affected Component: Sunstone, CLI
  • Version: from 5.10

Progress Status

  • Branch created
  • Code committed to development branch
  • Testing - QA
  • Documentation
  • Release notes - resolved issues, compatibility, known issues
  • Code committed to upstream release/hotfix branches
  • Documentation committed to upstream release/hotfix branches
@sbbarragan
Copy link

sbbarragan commented Apr 1, 2020

PR's:

rsmontero pushed a commit that referenced this issue Apr 1, 2020
tinova pushed a commit to OpenNebula/docs that referenced this issue Apr 1, 2020
@tinova
Copy link
Member

tinova commented Apr 1, 2020

needs test

rsmontero pushed a commit that referenced this issue Apr 1, 2020
atodorov-storpool pushed a commit to storpool/one that referenced this issue Apr 2, 2020
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

4 participants