RFE: Tacker Automatic Image Creation doesn't work on parameterized imagesource

Bug #1813135 reported by Martin Ivanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
High
Cong Phuoc Hoang

Bug Description

Template:

description: Demo example with auto image creation
metadata: {template_name: sample-tosca-vnfd-image}
topology_template:
  inputs:
   imagesource:
    type: string
    description: Disk Size.
   cpus:
    type: integer
    description: Number of CPUs for the server.
   mempagesize:
    type: integer
    description: Memory page size.
   disksz:
    type: string
    description: Disk Size.
   memsz:
    type: string
    description: RAM Memory.
   availabilityzone:
    type: string
    description: The controller availability zone.
   instancename:
    type: string
    description: The name of the instance.
   net1cidr:
    type: string
    description: Net 1 network address and mask.
   net1ipversion:
    type: integer
    description: Net 1 ip version.
   net1name:
    type: string
    description: Name of the network 1.
   net1type:
    type: string
    description: Type of the network 1.
   net1physnet:
    type: string
    description: Type of the network 1.
   net1vlanid:
    type: integer
    description: Net 1 vlan ID.
   net2cidr:
    type: string
    description: Net 2 network address and mask.
   net2ipversion:
    type: integer
    description: Net 2 ip version.
   net2name:
    type: string
    description: Name of the network 2.
   net2type:
    type: string
    description: Type of the network 2.
   net2physnet:
    type: string
    description: Type of the network 2.
   net2vlanid:
    type: integer
    description: Net 2 vlan ID.
   net3cidr:
    type: string
    description: Net 3 network address and mask.
   net3ipversion:
    type: integer
    description: Net 3 ip version.
   net3name:
    type: string
    description: Name of the network 3.
   net3type:
    type: string
    description: Type of the network 3.
   net3physnet:
    type: string
    description: Type of the network 3.
   net3vlanid:
    type: integer
    description: Net 3 vlan ID.

  node_templates:
    CP1:
      requirements:
      - virtualLink: {node: VL1}
      - virtualBinding: {node: VDU}
      type: tosca.nodes.nfv.CP.Tacker
    CP2:
      requirements:
      - virtualLink: {node: VL2}
      - virtualBinding: {node: VDU}
      type: tosca.nodes.nfv.CP.Tacker
    CP3:
      requirements:
      - virtualLink: {node: VL3}
      - virtualBinding: {node: VDU}
      type: tosca.nodes.nfv.CP.Tacker
    VDU:
      artifacts: { VNF1: {file: { get_input: imagesource}, type: tosca.artifacts.Deployment.Image.VM}}
      capabilities:
        nfv_compute:
          properties:
            cpu_allocation: {cpu_affinity: dedicated}
            disk_size: { get_input: disksz }
            mem_page_size: { get_input: mempagesize }
            mem_size: { get_input: memsz }
            num_cpus: { get_input: cpus }
      properties: {availability_zone: { get_input: availabilityzone }, name: { get_input instancename} }
      type: tosca.nodes.nfv.VDU.Tacker
    VL1:
      properties: {cidr: { get_input: net1cidr }, ip_version: { get_input: net1ipversion }, network_name: { get_input: net1name }, network_type: { get_input: net1type }, physical_network: { get_input: net1physnet }, segmentation_id: { get_input: net1vlanid }, vendor: Tacker}
      type: tosca.nodes.nfv.VL
    VL2:
      properties: {cidr: { get_input: net2cidr }, ip_version: { get_input: net2ipversion }, network_name: { get_input: net2name }, network_type: { get_input: net2type }, physical_network: { get_input: net2physnet }, segmentation_id: { get_input: net2vlanid }, vendor: Tacker}
      type: tosca.nodes.nfv.VL
    VL3:
      properties: {cidr: { get_input: net3cidr }, ip_version: { get_input: net3ipversion }, network_name: { get_input: net3name }, network_type: { get_input: net3type }, physical_network: { get_input: net3physnet }, segmentation_id: { get_input: net3vlanid }, vendor: Tacker}
      type: tosca.nodes.nfv.VL
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0

Parameter's file:

imagesource: 'http://10.3.131.138:8000/vnfs/servcie_chain_vnf/Brocade_service_chain_VNF.qcow2'
instancename: "Brocade"
availabilityzone: "nova"
cpus: 2
mempagesize: 1024
memsz: "2048 MB"
disksz: "20 GB"
mempagesize: 1024
disksz: "20 GB"
memsz: "2048 MB"
net1cidr: "10.3.0.0/16"
net1ipversion: 4
net1name: "net1test"
net1type: "vlan"
net1physnet: "physnet1"
net1vlanid: 10
net2cidr: "20.0.0.0/24"
net2ipversion: 4
net2name: "net2test"
net2type: "vlan"
net2physnet: "physnet1"
net2vlanid: 20
net3cidr: "30.0.0.0/24"
net3ipversion: 4
net3name: "net3test"
net3type: "vlan"
net3physnet: "physnet1"
net3vlanid: 30

Error returned:

Error: Failed to create VNF: ERROR: Property error: : resources.VDU_image.properties.location: : Value must be a string

Revision history for this message
Cong Phuoc Hoang (hoangphuoc) wrote :
Revision history for this message
Martin Ivanov (martin76) wrote :

We are trying to achieve different thing than the example you provided.
The image URL to be specified using parameter.

Revision history for this message
Cong Phuoc Hoang (hoangphuoc) wrote :

I will spend time look at it :). Thanks!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

Fix proposed to branch: master
Review: https://review.openstack.org/634469

Changed in tacker:
assignee: nobody → Cong Phuoc Hoang (hoangphuoc)
status: New → In Progress
Changed in tacker:
importance: Undecided → High
milestone: none → stein-3
Changed in tacker:
assignee: Cong Phuoc Hoang (hoangphuoc) → dharmendra (dharmendra-kushwaha)
Revision history for this message
dharmendra (dharmendra-kushwaha) wrote :

not sure how it goes assigned to me.
As Phuoc worked on it, so assigning back.

@Phuoc any update on it?

Changed in tacker:
assignee: dharmendra (dharmendra-kushwaha) → Cong Phuoc Hoang (hoangphuoc)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.openstack.org/649910

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.openstack.org/634469
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=c981d65451e9e17b9ae025f89b9c754fda61cd2a
Submitter: Zuul
Branch: master

commit c981d65451e9e17b9ae025f89b9c754fda61cd2a
Author: Cong Phuoc Hoang <email address hidden>
Date: Sat Feb 2 03:50:27 2019 +0900

    Fix issue in 'post_process_heat_template' function

    If users specify parameters in 'flavor' or 'image' properties
    of a VDU, HOT template can not be processed properly because
    there is a missmatch between TOSCA and HOT template.

    This patch will change 'get_input' to 'get_param' to fix that
    issue.

    Change-Id: I353e9d9d70dc6249a62dcdd1281b7b60d28d7d30
    Closes-Bug: #1813135
    Depends-On: Ib95ed31c70073cb732d41defe5bdc8027eadfeec

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (stable/stein)

Reviewed: https://review.openstack.org/649910
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=2ee2affbaae165b0affc55eccd825c0a8ea841eb
Submitter: Zuul
Branch: stable/stein

commit 2ee2affbaae165b0affc55eccd825c0a8ea841eb
Author: Cong Phuoc Hoang <email address hidden>
Date: Sat Feb 2 03:50:27 2019 +0900

    Fix issue in 'post_process_heat_template' function

    If users specify parameters in 'flavor' or 'image' properties
    of a VDU, HOT template can not be processed properly because
    there is a missmatch between TOSCA and HOT template.

    This patch will change 'get_input' to 'get_param' to fix that
    issue.

    Co-Authored-By: Dharmendra Kushwaha<email address hidden>
    Change-Id: I353e9d9d70dc6249a62dcdd1281b7b60d28d7d30
    Closes-Bug: #1813135

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 1.0.0.0rc2

This issue was fixed in the openstack/tacker 1.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 2.0.0.0rc1

This issue was fixed in the openstack/tacker 2.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.