LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   [DevStack] ERROR: Duplicate names {'internal_net2'} (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/%5Bdevstack%5D-error-duplicate-names-%7Binternal_net2%7D-4175677607/)

czezz 06-25-2020 07:48 AM

[DevStack] ERROR: Duplicate names {'internal_net2'}
 
Hi all,
Im trying to deploy stack with 3 VMs and 1 VN/Subnet.
My problem is that when I deploy it over following HOT package/template it complains:
Code:

stack@vlab:~$ openstack stack create -t HOT_test_net.yaml HOT_test_net
ERROR: Duplicate names {'internal_net2'}

Then, when I remove following part:
Code:

  internal_net2:
    type: string
    default: "InternalNetwork"

Then I get this error but as far as I can say VM-3_port1 does have internal_net2 provided/assigned.
Code:

stack@vlab:~$ openstack stack create -t HOT_test_net.yaml HOT_test_net
ERROR: Property error: : resources.VM-3_port1.properties.network: : The Parameter (internal_net2) was not provided.

Can anyone help here, please?

Code:

heat_template_version: 2014-10-16

description: HOT template for ECO instance

parameters:
  VM_flavor:
    type: string
    default: "rr1.small"

  VM_image:
    type: string
    default: "cirros-0.4.0-x86_64-disk"

  VM_availability_zone:
    type: string
    default: "RX-1"

  VM_nodename1:
    type: string
    default: "VM_1"

  VM_nodename2:
    type: string
    default: "VM_2"

  VM_nodename3:
    type: string
    default: "VM_3"

  internal_net2:
    type: string
    default: "InternalNetwork"
  VM_node1_IP_int:
    type: string
    default: "192.168.50.6"

  VM_node2_IP_int:
    type: string
    default: "192.168.50.7"

  VM_node3_IP_int:
    type: string
    default: "192.168.50.8"

resources:
  internal_net2:
    type: OS::Neutron::Net
    properties:
      admin_state_up: true
      name: internal_net2
  internal_net2_subnet:
    type: OS::Neutron::Subnet
    properties:
      network: { get_resource: internal_net2 }
      cidr: "192.168.50.0/24"
      dns_nameservers: ["8.8.8.8"]
      gateway_ip: "192.168.50.1"
      ip_version: 4
  VM-1_port1:
    type: OS::Neutron::Port
    properties:
      name: Port_VM-1
      network: { get_param: internal_net2 }
      fixed_ips:
        - ip_address: { get_param: VM_node1_IP_int }
 
  VM-2_port1:
    type: OS::Neutron::Port
    properties:
      name: Port_VM-2
      network: { get_param: internal_net2 }
      fixed_ips:
        - ip_address: { get_param: VM_node2_IP_int }
 
  VM-3_port1:
    type: OS::Neutron::Port
    properties:
      name: Port_VM-3
      network: { get_param: internal_net2 }
      fixed_ips:
        - ip_address: { get_param: VM_node3_IP_int }
   
  VM-1:
    type: OS::Nova::Server
    properties:
      config_drive: "true"
      name: { get_param: VM_nodename1 }
      flavor: { get_param: VM_flavor }
      image: { get_param: VM_image }
      availability_zone: { get_param: VM_availability_zone }
      networks:
        - port: { get_resource: VM-1_port1 }

  VM-2:
    type: OS::Nova::Server
    properties:
      config_drive: "true"
      name: { get_param: VM_nodename2 }
      flavor: { get_param: VM_flavor }
      image: { get_param: VM_image }
      availability_zone: { get_param: VM_availability_zone }
      networks:
      - port: { get_resource: VM-2_port1 }

  VM-3:
    type: OS::Nova::Server
    properties:
      config_drive: "true"
      name: { get_param: VM_nodename3 }
      flavor: { get_param: VM_flavor }
      image: { get_param: VM_image }
      availability_zone: { get_param: VM_availability_zone }
      networks:
      - port: { get_resource: VM-3_port1 }


berndbausch 06-25-2020 09:20 AM

I can't try this out right now, but here are two comments.
Run openstack stack validate to see if the error refers to an inconsistency in the template or is caused by inconsistencies between template and the cloud.
You use the string "internal_net2" at least three times in the template. Use different strings to make is less confusing and to understand which of the strings causes the error.


All times are GMT -5. The time now is 05:03 AM.