The basic policy to govern address assignment to CPs.

Definition

policy_types:
  onap.policies.AddressAssignment:
    description: governs address assignment to CPs
    derived_from: tosca.policies.Root
    properties:
      automatic_assignment:
        type: boolean
        required: false
      address_type:
        type: string
        required: false
        constraints:
          - valid_values: [IPv4, IPv6, Mac]
    # create derived types to carry extra info, like is_floating_ip, pool size/id, etc.


Derivations (Draft)

Address Assignment Policies
policy_types:
  onap.policies.address_assignment.Manual:
    derived_from: onap.policies.AddressAssignment
    description: an oversimplistic way to specify the address manually
    properties:
      automatic_assignment:
        description: always manual for this policy type
        type: boolean
        constraints:
          - equal: false
      address:
        description: |
          to assign the address in design time;
          if missing or cannot be assigned, then prompt the operator during instantiation
        type: string
        required: false
        
  onap.policies.address_assignment.ByPlan:
    derived_from: onap.policies.AddressAssignment
    description: automatic assignment with addresses out of a specified pool
    properties:
      automatic_assignment:
        description: always automatic for this policy type
        type: boolean
        constraints:
          - equal: true
      min_address:
        type: string
        required: false
      max_address:
        type: string
        required: false
      num_addresses:
        type: string
        required: false
      plan_name:
        description: the name of a pre-allocated address pool to take the addresses from
        type: string
        required: false


Example

Address assignment policy usage
topology_template:        
  node_templates:
    cp_1:
    cp_2:
    cp_3:
    cp_4:
    cp_5:
  
  policies:
    assign_addresses_1:
      type: onap.policies.address_assignment.Manual
      address_type: IPv4
      address: "10.20.30.40"
      targets: [cp_1]

    assign_addresses_2:
      type: onap.policies.address_assignment.Manual
      address_type: IPv6
      targets: [cp_5]
      # address:  the address property is not assigned, so ask the operator during instantiation

    assign_addresses_3:
      type: onap.policies.address_assignment.ByPlan
      targets: [cp_2, cp_3, cp_4]






  • No labels

2 Comments

  1. Hi Anatoly

    Can you provide an example describing the usage of this policy?

    1. Added the examples.

      This is the very first draft, just to explain the idea..