<commit_before># Config to bring up sub-interfaces

# mod probe 8021q
# ip link add link eth0 name eth0.50 type vlan id 50

heat_template_version: 2015-04-30

description: HOT to create sub-interface (VLAN) on instances

parameters:
  private_net_name_0:
    type: string
  private_net_cidr_0:
    type: string
  private_net_gateway_0:
    type: string
  private_net_name_1:
    type: string
  private_net_cidr_1:
    type: string
  private_net_gateway_1:
    type: string
  primary_interface_1:
    type: string
  primary_interface_2:
    type: string
  sub_interface_1:
    type: string
  sub_interface_2:
    type: string
  vlan_tag_1:
    type: number
  VMI_name_1:
    type: string
  VMI_name_2:
    type: string
  server_left_name:
    type: string
  server_right_name:
    type: string
  image:
    type: string
  flavor:
    type: string

resources:
  private_net_0:
    type: OS::Neutron::Net
    properties:
      name: { get_param: private_net_name_0 }

  private_subnet_0:
    type: OS::Neutron::Subnet
    properties:
      network_id: { get_resource: private_net_0 }
      cidr: { get_param: private_net_cidr_0 }
      gateway_ip: { get_param: private_net_gateway_0 }

  server_1:
    type: OS::Nova::Server
    properties:
      name: { get_param: server_left_name }
      image: { get_param: image }
      flavor: { get_param: flavor }
      networks:
        - network: { get_resource: private_net_0 }
      user_data: 
        str_replace:
          template: |
            #!/bin/bash
            modprobe 8021q
            vconfig add $primary_interface $vlan_tag
            dhclient $sub_interface
          params:
            $primary_interface: { get_param: primary_interface_1 }<commit_msg>Update contrail-create-subint.yaml<commit_after># Config to bring up sub-interfaces

# mod probe 8021q
# ip link add link eth0 name eth0.50 type vlan id 50

heat_template_version: 2015-04-30

description: HOT to create sub-interface (VLAN) on instances

parameters:
  private_net_name_0:
    type: string
  private_net_cidr_0:
    type: string
  private_net_gateway_0:
    type: string
  private_net_name_1:
    type: string
  private_net_cidr_1:
    type: string
  private_net_gateway_1:
    type: string
  primary_interface_1:
    type: string
  primary_interface_2:
    type: string
  sub_interface_1:
    type: string
  sub_interface_2:
    type: string
  vlan_tag_1:
    type: number
  VMI_name_1:
    type: string
  VMI_name_2:
    type: string
  server_left_name:
    type: string
  server_right_name:
    type: string
  image:
    type: string
  flavor:
    type: string

resources:
  private_net_0:
    type: OS::Neutron::Net
    properties:
      name: { get_param: private_net_name_0 }

  private_subnet_0:
    type: OS::Neutron::Subnet
    properties:
      network_id: { get_resource: private_net_0 }
      cidr: { get_param: private_net_cidr_0 }
      gateway_ip: { get_param: private_net_gateway_0 }

  server_1:
    type: OS::Nova::Server
    properties:
      name: { get_param: server_left_name }
      image: { get_param: image }
      flavor: { get_param: flavor }
      networks:
        - network: { get_resource: private_net_0 }
      user_data: 
        str_replace:
          template: |
            #!/bin/bash
            modprobe 8021q
            ip link add link $primary_interface name $primary_interface.$vlan_tag type vlan id $vlan_tag
            dhclient $sub_interface
          params:
            $primary_interface: { get_param: primary_interface_1 }
{'fraction_non_alphanumeric': 0.07189728958630527, 'fraction_numerical': 0.025106990014265335, 'mean_word_length': 2.798483206933911, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5548266', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1212, 'n_words': 280}