another merging with master branch
diff --git a/containers/MCORDServiceVBBU.yaml b/containers/MCORDServiceVBBU.yaml
deleted file mode 100644
index 406c83e..0000000
--- a/containers/MCORDServiceVBBU.yaml
+++ /dev/null
@@ -1,162 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: Setup MCORD-related services.
-
-imports:
- - custom_types/xos.yaml
-
-node_types:
- tosca.nodes.MCORDComponent:
- derived_from: tosca.nodes.Root
- description: >
- CORD: A Service Component of MCORD Service.
- properties:
- kind:
- type: string
- default: generic
- description: Kind of component
- s_tag:
- type: string
- required: false
- default: 200
- description: VTN stag port-name
- display_message:
- type: string
- required: false
- default: MCORD Component ready
- description: Component message
-
-topology_template:
- node_templates:
-
- Stanford_Deployment:
- type: tosca.nodes.Deployment
-
- computeBBU1:
- type: tosca.nodes.Node
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.MemberOfDeployment
-
- Topology:
- type: tosca.nodes.DashboardView
- properties:
- url: template:xosMcordTopology
-
- padmin@vicci.org:
- type: tosca.nodes.User
- properties:
- firstname: XOS
- lastname: admin
- is_admin: true
- requirements:
- - mcord_dashboard:
- node: Topology
- relationship: tosca.relationships.UsesDashboard
-
- # SERIVCES
- vBBU:
- type: tosca.nodes.Service
- requirements:
- properties:
- view_url: /admin/mcordservice/
- kind: RAN
-
- # Network Templates
- Private:
- type: tosca.nodes.NetworkTemplate
-
- management_template:
- type: tosca.nodes.NetworkTemplate
- properties:
- visibility: private
- translation: none
-
- # Network
- Stanford_University_vBBU_network:
- type: tosca.nodes.network.Network.XOS
- properties:
- ip_version: 4
- labels: mcord_service_internal_net
- cidr: 172.16.16.0/24
- start_ip: 172.16.16.2
- end_ip: 172.16.16.5
- gateway_ip: 172.16.16.1
- requirements:
- - network_template:
- node: Private
- relationship: tosca.relationships.UsesNetworkTemplate
- - owner:
- node: Stanford_University_vBBU_slice
- relationship: tosca.relationships.MemberOfSlice
- - connection:
- node: Stanford_University_vBBU_slice
- relationship: tosca.relationships.ConnectsToSlice
-
- management:
- type: tosca.nodes.network.Network
- properties:
- ip_version: 4
- cidr: 10.102.90.0/24
- requirements:
- - network_template:
- node: management_template
- relationship: tosca.relationships.UsesNetworkTemplate
- - owner:
-# node: Stanford_University_vBBU_slice
- node: Stanford_University_management
- relationship: tosca.relationships.MemberOfSlice
-# - connection:
-# node: Stanford_University_vBBU_slice
-# relationship: tosca.relationships.ConnectsToSlice
-
-
- Stanford_University:
- type: tosca.nodes.Site
-
- ubuntu-14.04-server-cloudimg-amd64-disk1:
- type: tosca.nodes.Image
-
- Stanford_University_management:
- description: This slice exists solely to own the management network
- type: tosca.nodes.Slice
- properties:
- network: noauto
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
-
- Stanford_University_vBBU_slice:
- description: vBBU Service Slice
- type: tosca.nodes.Slice
-# properties:
-# network: noauto
- requirements:
- - mcord_service:
- node: vBBU
- relationship: tosca.relationships.MemberOfService
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- - default_image:
- node: ubuntu-14.04-server-cloudimg-amd64-disk1
- relationship: tosca.relationships.DefaultImage
- properties:
- default_flavor: m1.medium
- default_node: computeBBU2
-
- Stanford_University_vBBU_component:
- description: vBBU Service Component
- type: tosca.nodes.MCORDComponent
- requirements:
- - provider_service:
- node: vBBU
- relationship: tosca.relationships.MemberOfService
- - Stanford_University_vBBU_slice:
- node: Stanford_University_vBBU_slice
- relationship: tosca.relationships.MemberOfSlice
diff --git a/containers/setup.yaml.new b/containers/setup.yaml.new
deleted file mode 100644
index 3c7bf8b..0000000
--- a/containers/setup.yaml.new
+++ /dev/null
@@ -1,212 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- * Adds OpenCloud Sites, Deployments, and Controllers.
-
-imports:
- - custom_types/xos.yaml
-
-topology_template:
- node_templates:
-
- Stanford_Deployment:
- type: tosca.nodes.Deployment
- properties:
- flavors: m1.large, m1.medium, m1.small
-
- computeBBU1:
- type: tosca.nodes.Node
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.MemberOfDeployment
-
- computeBBU2:
- type: tosca.nodes.Node
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.MemberOfDeployment
-
- McordOpenStack:
- type: tosca.nodes.Controller
- requirements:
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.ControllerDeployment
- properties:
- backend_type: OpenStack
- version: Kilo
- auth_url: { get_script_env: [ SELF, adminrc, OS_AUTH_URL, LOCAL_FILE] }
- admin_user: { get_script_env: [ SELF, adminrc, OS_USERNAME, LOCAL_FILE] }
- admin_password: { get_script_env: [ SELF, adminrc, OS_PASSWORD, LOCAL_FILE] }
- admin_tenant: { get_script_env: [ SELF, adminrc, OS_TENANT_NAME, LOCAL_FILE] }
- domain: Default
- artifacts:
- adminrc: /root/setup/admin-openrc.sh
-
- Stanford_University:
- type: tosca.nodes.Site
- properties:
- display_name: Stanford University
- site_url: http://xosproject.org/
- requirements:
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.SiteDeployment
- requirements:
- - controller:
- node: McordOpenStack
- relationship: tosca.relationships.UsesController
-
- # This user already exists in XOS with this password
- # It's an example of how to create new users
- padmin@vicci.org:
- type: tosca.nodes.User
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- properties:
- is_admin: true
- is_active: true
- firstname: XOS
- lastname: admin
- password: letmein
-
- johndoe@stanford.us:
- type: tosca.nodes.User
- properties:
- password: letmein
- firstname: john
- lastname: doe
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
-
- # A subscriber
- Stanford:
- type: tosca.nodes.CORDSubscriber
- properties:
- service_specific_id: 123
- firewall_enable: false
- cdn_enable: false
- url_filter_enable: false
- url_filter_level: R
- requirements:
- - house_admin:
- node: johndoe@stanford.us
- relationship: tosca.relationships.AdminPrivilege
-
- Barbera Lapinski:
- type: tosca.nodes.CORDUser
- properties:
- mac: 01:02:03:04:05:06
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Norbert Shumway:
- type: tosca.nodes.CORDUser
- properties:
- mac: 90:E2:BA:82:F9:75
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Fay Muldoon:
- type: tosca.nodes.CORDUser
- properties:
- mac: 68:5B:35:9D:91:D5
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Janene Earnest:
- type: tosca.nodes.CORDUser
- properties:
- mac: 34:36:3B:C9:B6:A6
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- RRU:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vBBU
- icon_url: /static/mCordServices/service_rru.png
- kind: RAN
- vBBU:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vBBU
- icon_url: /static/mCordServices/service_server.png
- kind: RAN
-
- eSON:
- type: tosca.nodes.Service
- properties:
- icon_url: /static/mCordServices/service_server.png
- view_url: http://www.google.com
- kind: RAN
-
- # EPC
- vMME:
- type: tosca.nodes.Service
- properties:
- icon_url: /static/mCordServices/service_server.png
- view_url: /mcord/?service=vMME
- kind: vEPC
-
- vSGW:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vSGW
- icon_url: /static/mCordServices/service_server.png
- kind: vEPC
-
- vPGW:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vPGW
- icon_url: /static/mCordServices/service_server.png
- kind: vEPC
-
- # EDGE
- Cache:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Cache
- icon_url: /static/mCordServices/service_cache.png
- kind: EDGE
-
- Firewall:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Firewall
- icon_url: /static/mCordServices/service_firewall.png
- kind: EDGE
-
- Video Optimization:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Video%20Optimization
- icon_url: /static/mCordServices/service_video.png
- kind: EDGE
-
-
diff --git a/containers/setup.yaml.old b/containers/setup.yaml.old
deleted file mode 100644
index c13f0eb..0000000
--- a/containers/setup.yaml.old
+++ /dev/null
@@ -1,61 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- * Adds OpenCloud Sites, Deployments, and Controllers.
-
-imports:
- - custom_types/xos.yaml
-
-topology_template:
- node_templates:
-
- MyDeployment:
- type: tosca.nodes.Deployment
- properties:
- flavors: m1.large, m1.medium, m1.small
-
- MyOpenStack:
- type: tosca.nodes.Controller
- requirements:
- - deployment:
- node: MyDeployment
- relationship: tosca.relationships.ControllerDeployment
- properties:
- backend_type: OpenStack
- version: Kilo
- auth_url: { get_script_env: [ SELF, adminrc, OS_AUTH_URL, LOCAL_FILE] }
- admin_user: { get_script_env: [ SELF, adminrc, OS_USERNAME, LOCAL_FILE] }
- admin_password: { get_script_env: [ SELF, adminrc, OS_PASSWORD, LOCAL_FILE] }
- admin_tenant: { get_script_env: [ SELF, adminrc, OS_TENANT_NAME, LOCAL_FILE] }
- domain: Default
- artifacts:
- adminrc: /root/setup/admin-openrc.sh
-
- mysite:
- type: tosca.nodes.Site
- properties:
- display_name: MySite
- site_url: http://xosproject.org/
- requirements:
- - deployment:
- node: MyDeployment
- relationship: tosca.relationships.SiteDeployment
- requirements:
- - controller:
- node: MyOpenStack
- relationship: tosca.relationships.UsesController
-
- # This user already exists in XOS with this password
- # It's an example of how to create new users
- padmin@vicci.org:
- type: tosca.nodes.User
- requirements:
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
- properties:
- is_admin: true
- is_active: true
- firstname: XOS
- lastname: admin
- password: letmein
diff --git a/containers/tmp.yaml b/containers/tmp.yaml
deleted file mode 100644
index 32f2a12..0000000
--- a/containers/tmp.yaml
+++ /dev/null
@@ -1,130 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- * Adds OpenCloud Sites, Deployments, and Controllers.
-
-imports:
- - custom_types/xos.yaml
-
- johndoe@stanford.us:
- type: tosca.nodes.User
- properties:
- password: letmein
- firstname: john
- lastname: doe
- requirements:
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
-
- # A subscriber
- Stanford:
- type: tosca.nodes.CORDSubscriber
- properties:
- service_specific_id: 123
- firewall_enable: false
- cdn_enable: false
- url_filter_enable: false
- url_filter_level: R
- requirements:
- - house_admin:
- node: johndoe@stanford.us
- relationship: tosca.relationships.AdminPrivilege
-
- Barbera Lapinski:
- type: tosca.nodes.CORDUser
- properties:
- mac: 01:02:03:04:05:06
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Norbert Shumway:
- type: tosca.nodes.CORDUser
- properties:
- mac: 90:E2:BA:82:F9:75
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Fay Muldoon:
- type: tosca.nodes.CORDUser
- properties:
- mac: 68:5B:35:9D:91:D5
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Janene Earnest:
- type: tosca.nodes.CORDUser
- properties:
- mac: 34:36:3B:C9:B6:A6
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- RRU:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vBBU
- icon_url: /static/mCordServices/service_rru.png
- kind: RAN
-
- eSON:
- type: tosca.nodes.Service
- properties:
- icon_url: /static/mCordServices/service_server.png
- view_url: http://www.google.com
- kind: RAN
-
- # EPC
- vMME:
- type: tosca.nodes.Service
- properties:
- icon_url: /static/mCordServices/service_server.png
- view_url: /mcord/?service=vMME
- kind: vEPC
-
- vSGW:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vSGW
- icon_url: /static/mCordServices/service_server.png
- kind: vEPC
-
- vPGW:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vPGW
- icon_url: /static/mCordServices/service_server.png
- kind: vEPC
-
- # EDGE
- Cache:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Cache
- icon_url: /static/mCordServices/service_cache.png
- kind: EDGE
-
- Firewall:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Firewall
- icon_url: /static/mCordServices/service_firewall.png
- kind: EDGE
-
- Video Optimization:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Video%20Optimization
- icon_url: /static/mCordServices/service_video.png
- kind: EDGE
diff --git a/containers/tmp2.yaml b/containers/tmp2.yaml
deleted file mode 100644
index 3c7bf8b..0000000
--- a/containers/tmp2.yaml
+++ /dev/null
@@ -1,212 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- * Adds OpenCloud Sites, Deployments, and Controllers.
-
-imports:
- - custom_types/xos.yaml
-
-topology_template:
- node_templates:
-
- Stanford_Deployment:
- type: tosca.nodes.Deployment
- properties:
- flavors: m1.large, m1.medium, m1.small
-
- computeBBU1:
- type: tosca.nodes.Node
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.MemberOfDeployment
-
- computeBBU2:
- type: tosca.nodes.Node
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.MemberOfDeployment
-
- McordOpenStack:
- type: tosca.nodes.Controller
- requirements:
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.ControllerDeployment
- properties:
- backend_type: OpenStack
- version: Kilo
- auth_url: { get_script_env: [ SELF, adminrc, OS_AUTH_URL, LOCAL_FILE] }
- admin_user: { get_script_env: [ SELF, adminrc, OS_USERNAME, LOCAL_FILE] }
- admin_password: { get_script_env: [ SELF, adminrc, OS_PASSWORD, LOCAL_FILE] }
- admin_tenant: { get_script_env: [ SELF, adminrc, OS_TENANT_NAME, LOCAL_FILE] }
- domain: Default
- artifacts:
- adminrc: /root/setup/admin-openrc.sh
-
- Stanford_University:
- type: tosca.nodes.Site
- properties:
- display_name: Stanford University
- site_url: http://xosproject.org/
- requirements:
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.SiteDeployment
- requirements:
- - controller:
- node: McordOpenStack
- relationship: tosca.relationships.UsesController
-
- # This user already exists in XOS with this password
- # It's an example of how to create new users
- padmin@vicci.org:
- type: tosca.nodes.User
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- properties:
- is_admin: true
- is_active: true
- firstname: XOS
- lastname: admin
- password: letmein
-
- johndoe@stanford.us:
- type: tosca.nodes.User
- properties:
- password: letmein
- firstname: john
- lastname: doe
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
-
- # A subscriber
- Stanford:
- type: tosca.nodes.CORDSubscriber
- properties:
- service_specific_id: 123
- firewall_enable: false
- cdn_enable: false
- url_filter_enable: false
- url_filter_level: R
- requirements:
- - house_admin:
- node: johndoe@stanford.us
- relationship: tosca.relationships.AdminPrivilege
-
- Barbera Lapinski:
- type: tosca.nodes.CORDUser
- properties:
- mac: 01:02:03:04:05:06
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Norbert Shumway:
- type: tosca.nodes.CORDUser
- properties:
- mac: 90:E2:BA:82:F9:75
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Fay Muldoon:
- type: tosca.nodes.CORDUser
- properties:
- mac: 68:5B:35:9D:91:D5
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Janene Earnest:
- type: tosca.nodes.CORDUser
- properties:
- mac: 34:36:3B:C9:B6:A6
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- RRU:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vBBU
- icon_url: /static/mCordServices/service_rru.png
- kind: RAN
- vBBU:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vBBU
- icon_url: /static/mCordServices/service_server.png
- kind: RAN
-
- eSON:
- type: tosca.nodes.Service
- properties:
- icon_url: /static/mCordServices/service_server.png
- view_url: http://www.google.com
- kind: RAN
-
- # EPC
- vMME:
- type: tosca.nodes.Service
- properties:
- icon_url: /static/mCordServices/service_server.png
- view_url: /mcord/?service=vMME
- kind: vEPC
-
- vSGW:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vSGW
- icon_url: /static/mCordServices/service_server.png
- kind: vEPC
-
- vPGW:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vPGW
- icon_url: /static/mCordServices/service_server.png
- kind: vEPC
-
- # EDGE
- Cache:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Cache
- icon_url: /static/mCordServices/service_cache.png
- kind: EDGE
-
- Firewall:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Firewall
- icon_url: /static/mCordServices/service_firewall.png
- kind: EDGE
-
- Video Optimization:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Video%20Optimization
- icon_url: /static/mCordServices/service_video.png
- kind: EDGE
-
-
diff --git a/xos/configurations/mcord/fixtures2.yaml b/xos/configurations/mcord/fixtures2.yaml
deleted file mode 100644
index ab16e85..0000000
--- a/xos/configurations/mcord/fixtures2.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: Setup MCORD-related services.
-
-imports:
- - custom_types/xos.yaml
-
-node_types:
- tosca.nodes.VBBUComponent:
- derived_from: tosca.nodes.Root
- description: >
- CORD: vBBU Component of MCORD Service.
- properties:
- kind:
- type: string
- default: generic
- description: Kind of component
- s1u_tag:
- type: string
- required: false
- default: 201
- description: VTN stag port-name
- s1mme_tag:
- type: string
- required: false
- default: 200
- description: VTN stag port-name
- rru_tag:
- type: string
- required: false
- default: 199
- description: VTN stag port-name
-
diff --git a/xos/configurations/mcord/tosca_tmp/mcord.yaml b/xos/configurations/mcord/tosca_tmp/mcord.yaml
deleted file mode 100644
index 971e7a9..0000000
--- a/xos/configurations/mcord/tosca_tmp/mcord.yaml
+++ /dev/null
@@ -1,249 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: Setup MCORD-related services.
-
-imports:
- - custom_types/xos.yaml
-
-node_types:
-
- tosca.nodes.MCORDService:
- derived_from: tosca.nodes.Root
- description: >
- An XOS Service object. Services may be listed in the Service
- directory and may be linked together via Tenancy Relationships.
- capabilities:
- scalable:
- type: tosca.capabilities.Scalable
- service:
- type: tosca.capabilities.xos.Service
- properties:
- no-delete:
- type: boolean
- default: false
- description: Do not allow Tosca to delete this object
- no-create:
- type: boolean
- default: false
- description: Do not allow Tosca to create this object
- no-update:
- type: boolean
- default: false
- description: Do not allow Tosca to update this object
- kind:
- type: string
- default: generic
- description: Type of service.
- view_url:
- type: string
- required: false
- description: URL to follow when icon is clicked in the Service Directory.
- icon_url:
- type: string
- required: false
- description: ICON to display in the Service Directory.
- enabled:
- type: boolean
- default: true
- published:
- type: boolean
- default: true
- description: If True then display this Service in the Service Directory.
- public_key:
- type: string
- required: false
- description: Public key to install into Instances to allows Services to SSH into them.
- private_key_fn:
- type: string
- required: false
- description: Location of private key file
- versionNumber:
- type: string
- required: false
- description: Version number of Service.
-
- tosca.nodes.VBBUComponent:
- derived_from: tosca.nodes.Root
- description: >
- CORD: vBBU Component of MCORD Service.
- properties:
- kind:
- type: string
- default: generic
- description: Kind of component
- s1u_tag:
- type: string
- required: false
- default: 201
- description: VTN stag port-name
- s1mme_tag:
- type: string
- required: false
- default: 200
- description: VTN stag port-name
- rru_tag:
- type: string
- required: false
- default: 199
- description: VTN stag port-name
- display_message:
- type: string
- required: false
- description: Just a message
-
-
-topology_template:
- node_templates:
- service_mcord:
- type: tosca.nodes.MCORDService
- requirements:
- properties:
- kind: Mobile Services
- view_url: /mcord/mcordservice
- public_key: { get_artifact: [ SELF, pubkey, LOCAL_FILE] }
- private_key_fn: /opt/xos/configurations/mcord/mcord_private_key
- artifacts:
- pubkey: /opt/xos/configurations/mcord/mcord_public_key
-
-
- Private:
- type: tosca.nodes.NetworkTemplate
-
- External:
- type: tosca.nodes.NetworkTemplate
-
- management_template:
- type: tosca.nodes.NetworkTemplate
- properties:
- visibility: private
- translation: none
-
- management:
- type: tosca.nodes.network.Network.XOS
-# properties:
-# no-create: true
-# no-delete: true
-# no-update: true
-
- lan_3gpp_s1mme_network:
- type: tosca.nodes.network.Network.XOS
- properties:
- ip_version: 4
- labels: lan_3gpp_s1uc_net
- cidr: 172.16.1.0/24
- start_ip: 172.16.1.3
- end_ip: 172.16.1.12
- gateway_ip: 172.16.1.1
- requirements:
- - network_template:
- node: External
- relationship: tosca.relationships.UsesNetworkTemplate
- - owner:
- node: mysite_mobile_net
- relationship: tosca.relationships.MemberOfSlice
- - connection:
- node: mysite_vbbu_slice1
- relationship: tosca.relationships.ConnectsToSlice
-
- lan_3gpp_s1u_network:
- type: tosca.nodes.network.Network.XOS
- properties:
- ip_version: 4
- labels: lan_3gpp_s1u_net
- cidr: 172.16.2.0/24
- start_ip: 172.16.2.3
- end_ip: 172.16.2.12
- gateway_ip: 172.16.16.1
- requirements:
- - network_template:
- node: External
- relationship: tosca.relationships.UsesNetworkTemplate
- - owner:
- node: mysite_mobile_net
- relationship: tosca.relationships.MemberOfSlice
- - connection:
- node: mysite_vbbu_slice1
- relationship: tosca.relationships.ConnectsToSlice
-
- lan_rru_network:
- type: tosca.nodes.network.Network.XOS
- properties:
- ip_version: 4
- labels: lan_rru_net
- cidr: 172.16.0.0/24
- start_ip: 172.16.0.3
- end_ip: 172.16.0.12
- gateway_ip: 172.16.0.1
- requirements:
- - network_template:
- node: External
- relationship: tosca.relationships.UsesNetworkTemplate
- - owner:
- node: mysite_mobile_net
- relationship: tosca.relationships.MemberOfSlice
- - connection:
- node: mysite_vbbu_slice1
- relationship: tosca.relationships.ConnectsToSlice
-
- mysite:
- type: tosca.nodes.Site
-
- mcord-bbu-multi-nic:
- type: tosca.nodes.Image
-
- mysite_management:
- description: This slice exists solely to own the management network
- type: tosca.nodes.Slice
- properties:
- network: noauto
- requirements:
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
-
- mysite_mobile_net:
- description: This slice exists solely to own the mobile network
- type: tosca.nodes.Slice
- properties:
- network: noauto
- requirements:
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
-
- mysite_vbbu_slice1:
- description: MCORD Service Slice 1
- type: tosca.nodes.Slice
- requirements:
- - mcord_service:
- node: service_mcord
- relationship: tosca.relationships.MemberOfService
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
- - default_image:
- node: mcord-bbu-multi-nic
- relationship: tosca.relationships.DefaultImage
- - management:
- node: management
- relationship: tosca.relationships.ConnectsToNetwork
- properties:
- network: noauto
- default_flavor: m1.xlarge
- default_node: computeBBU2
-
- mysite_VBBU_Component:
- description: MCORD Service default Component
- type: tosca.nodes.VBBUComponent
- requirements:
- - provider_service:
- node: service_mcord
- relationship: tosca.relationships.MemberOfService
- - vbbu_slice:
- node: mysite_vbbu_slice1
- relationship: tosca.relationships.MemberOfSlice
- properties:
- display_message: vBBU looks good!
- s1u_tag: 201
- s1mme_tag: 200
- rru_tag: 199
diff --git a/xos/configurations/mcord/tosca_tmp/setup.yaml.new b/xos/configurations/mcord/tosca_tmp/setup.yaml.new
deleted file mode 100644
index 3c7bf8b..0000000
--- a/xos/configurations/mcord/tosca_tmp/setup.yaml.new
+++ /dev/null
@@ -1,212 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- * Adds OpenCloud Sites, Deployments, and Controllers.
-
-imports:
- - custom_types/xos.yaml
-
-topology_template:
- node_templates:
-
- Stanford_Deployment:
- type: tosca.nodes.Deployment
- properties:
- flavors: m1.large, m1.medium, m1.small
-
- computeBBU1:
- type: tosca.nodes.Node
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.MemberOfDeployment
-
- computeBBU2:
- type: tosca.nodes.Node
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.MemberOfDeployment
-
- McordOpenStack:
- type: tosca.nodes.Controller
- requirements:
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.ControllerDeployment
- properties:
- backend_type: OpenStack
- version: Kilo
- auth_url: { get_script_env: [ SELF, adminrc, OS_AUTH_URL, LOCAL_FILE] }
- admin_user: { get_script_env: [ SELF, adminrc, OS_USERNAME, LOCAL_FILE] }
- admin_password: { get_script_env: [ SELF, adminrc, OS_PASSWORD, LOCAL_FILE] }
- admin_tenant: { get_script_env: [ SELF, adminrc, OS_TENANT_NAME, LOCAL_FILE] }
- domain: Default
- artifacts:
- adminrc: /root/setup/admin-openrc.sh
-
- Stanford_University:
- type: tosca.nodes.Site
- properties:
- display_name: Stanford University
- site_url: http://xosproject.org/
- requirements:
- - deployment:
- node: Stanford_Deployment
- relationship: tosca.relationships.SiteDeployment
- requirements:
- - controller:
- node: McordOpenStack
- relationship: tosca.relationships.UsesController
-
- # This user already exists in XOS with this password
- # It's an example of how to create new users
- padmin@vicci.org:
- type: tosca.nodes.User
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
- properties:
- is_admin: true
- is_active: true
- firstname: XOS
- lastname: admin
- password: letmein
-
- johndoe@stanford.us:
- type: tosca.nodes.User
- properties:
- password: letmein
- firstname: john
- lastname: doe
- requirements:
- - site:
- node: Stanford_University
- relationship: tosca.relationships.MemberOfSite
-
- # A subscriber
- Stanford:
- type: tosca.nodes.CORDSubscriber
- properties:
- service_specific_id: 123
- firewall_enable: false
- cdn_enable: false
- url_filter_enable: false
- url_filter_level: R
- requirements:
- - house_admin:
- node: johndoe@stanford.us
- relationship: tosca.relationships.AdminPrivilege
-
- Barbera Lapinski:
- type: tosca.nodes.CORDUser
- properties:
- mac: 01:02:03:04:05:06
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Norbert Shumway:
- type: tosca.nodes.CORDUser
- properties:
- mac: 90:E2:BA:82:F9:75
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Fay Muldoon:
- type: tosca.nodes.CORDUser
- properties:
- mac: 68:5B:35:9D:91:D5
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Janene Earnest:
- type: tosca.nodes.CORDUser
- properties:
- mac: 34:36:3B:C9:B6:A6
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- RRU:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vBBU
- icon_url: /static/mCordServices/service_rru.png
- kind: RAN
- vBBU:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vBBU
- icon_url: /static/mCordServices/service_server.png
- kind: RAN
-
- eSON:
- type: tosca.nodes.Service
- properties:
- icon_url: /static/mCordServices/service_server.png
- view_url: http://www.google.com
- kind: RAN
-
- # EPC
- vMME:
- type: tosca.nodes.Service
- properties:
- icon_url: /static/mCordServices/service_server.png
- view_url: /mcord/?service=vMME
- kind: vEPC
-
- vSGW:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vSGW
- icon_url: /static/mCordServices/service_server.png
- kind: vEPC
-
- vPGW:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vPGW
- icon_url: /static/mCordServices/service_server.png
- kind: vEPC
-
- # EDGE
- Cache:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Cache
- icon_url: /static/mCordServices/service_cache.png
- kind: EDGE
-
- Firewall:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Firewall
- icon_url: /static/mCordServices/service_firewall.png
- kind: EDGE
-
- Video Optimization:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Video%20Optimization
- icon_url: /static/mCordServices/service_video.png
- kind: EDGE
-
-
diff --git a/xos/configurations/mcord/tosca_tmp/setup.yaml.old b/xos/configurations/mcord/tosca_tmp/setup.yaml.old
deleted file mode 100644
index c13f0eb..0000000
--- a/xos/configurations/mcord/tosca_tmp/setup.yaml.old
+++ /dev/null
@@ -1,61 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- * Adds OpenCloud Sites, Deployments, and Controllers.
-
-imports:
- - custom_types/xos.yaml
-
-topology_template:
- node_templates:
-
- MyDeployment:
- type: tosca.nodes.Deployment
- properties:
- flavors: m1.large, m1.medium, m1.small
-
- MyOpenStack:
- type: tosca.nodes.Controller
- requirements:
- - deployment:
- node: MyDeployment
- relationship: tosca.relationships.ControllerDeployment
- properties:
- backend_type: OpenStack
- version: Kilo
- auth_url: { get_script_env: [ SELF, adminrc, OS_AUTH_URL, LOCAL_FILE] }
- admin_user: { get_script_env: [ SELF, adminrc, OS_USERNAME, LOCAL_FILE] }
- admin_password: { get_script_env: [ SELF, adminrc, OS_PASSWORD, LOCAL_FILE] }
- admin_tenant: { get_script_env: [ SELF, adminrc, OS_TENANT_NAME, LOCAL_FILE] }
- domain: Default
- artifacts:
- adminrc: /root/setup/admin-openrc.sh
-
- mysite:
- type: tosca.nodes.Site
- properties:
- display_name: MySite
- site_url: http://xosproject.org/
- requirements:
- - deployment:
- node: MyDeployment
- relationship: tosca.relationships.SiteDeployment
- requirements:
- - controller:
- node: MyOpenStack
- relationship: tosca.relationships.UsesController
-
- # This user already exists in XOS with this password
- # It's an example of how to create new users
- padmin@vicci.org:
- type: tosca.nodes.User
- requirements:
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
- properties:
- is_admin: true
- is_active: true
- firstname: XOS
- lastname: admin
- password: letmein
diff --git a/xos/configurations/mcord/tosca_tmp/tmp.yaml b/xos/configurations/mcord/tosca_tmp/tmp.yaml
deleted file mode 100644
index 32f2a12..0000000
--- a/xos/configurations/mcord/tosca_tmp/tmp.yaml
+++ /dev/null
@@ -1,130 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- * Adds OpenCloud Sites, Deployments, and Controllers.
-
-imports:
- - custom_types/xos.yaml
-
- johndoe@stanford.us:
- type: tosca.nodes.User
- properties:
- password: letmein
- firstname: john
- lastname: doe
- requirements:
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
-
- # A subscriber
- Stanford:
- type: tosca.nodes.CORDSubscriber
- properties:
- service_specific_id: 123
- firewall_enable: false
- cdn_enable: false
- url_filter_enable: false
- url_filter_level: R
- requirements:
- - house_admin:
- node: johndoe@stanford.us
- relationship: tosca.relationships.AdminPrivilege
-
- Barbera Lapinski:
- type: tosca.nodes.CORDUser
- properties:
- mac: 01:02:03:04:05:06
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Norbert Shumway:
- type: tosca.nodes.CORDUser
- properties:
- mac: 90:E2:BA:82:F9:75
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Fay Muldoon:
- type: tosca.nodes.CORDUser
- properties:
- mac: 68:5B:35:9D:91:D5
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Janene Earnest:
- type: tosca.nodes.CORDUser
- properties:
- mac: 34:36:3B:C9:B6:A6
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- RRU:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vBBU
- icon_url: /static/mCordServices/service_rru.png
- kind: RAN
-
- eSON:
- type: tosca.nodes.Service
- properties:
- icon_url: /static/mCordServices/service_server.png
- view_url: http://www.google.com
- kind: RAN
-
- # EPC
- vMME:
- type: tosca.nodes.Service
- properties:
- icon_url: /static/mCordServices/service_server.png
- view_url: /mcord/?service=vMME
- kind: vEPC
-
- vSGW:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vSGW
- icon_url: /static/mCordServices/service_server.png
- kind: vEPC
-
- vPGW:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vPGW
- icon_url: /static/mCordServices/service_server.png
- kind: vEPC
-
- # EDGE
- Cache:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Cache
- icon_url: /static/mCordServices/service_cache.png
- kind: EDGE
-
- Firewall:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Firewall
- icon_url: /static/mCordServices/service_firewall.png
- kind: EDGE
-
- Video Optimization:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=Video%20Optimization
- icon_url: /static/mCordServices/service_video.png
- kind: EDGE
diff --git a/xos/configurations/mcord/tosca_tmp/tmp2.yaml b/xos/configurations/mcord/tosca_tmp/tmp2.yaml
deleted file mode 100644
index 7282945..0000000
--- a/xos/configurations/mcord/tosca_tmp/tmp2.yaml
+++ /dev/null
@@ -1,75 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- * Adds OpenCloud Sites, Deployments, and Controllers.
-
-imports:
- - custom_types/xos.yaml
-
-topology_template:
- node_templates:
-
- # This user already exists in XOS with this password
- # It's an example of how to create new users
-
- johndoe@stanford.us:
- type: tosca.nodes.User
- properties:
- password: letmein
- firstname: john
- lastname: doe
-
- # A subscriber
- Stanford:
- type: tosca.nodes.CORDSubscriber
- properties:
- service_specific_id: 123
- firewall_enable: false
- cdn_enable: false
- url_filter_enable: false
- url_filter_level: R
- requirements:
- - house_admin:
- node: johndoe@stanford.us
- relationship: tosca.relationships.AdminPrivilege
-
- Barbera Lapinski:
- type: tosca.nodes.CORDUser
- properties:
- mac: 01:02:03:04:05:06
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Norbert Shumway:
- type: tosca.nodes.CORDUser
- properties:
- mac: 90:E2:BA:82:F9:75
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Fay Muldoon:
- type: tosca.nodes.CORDUser
- properties:
- mac: 68:5B:35:9D:91:D5
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
- Janene Earnest:
- type: tosca.nodes.CORDUser
- properties:
- mac: 34:36:3B:C9:B6:A6
- level: PG_13
- requirements:
- - household:
- node: Stanford
- relationship: tosca.relationships.SubscriberDevice
-
diff --git a/xos/services/mcord/models.py b/xos/services/mcord/models.py
index 1b2bd65..ed13ac3 100644
--- a/xos/services/mcord/models.py
+++ b/xos/services/mcord/models.py
@@ -15,6 +15,7 @@
from xos.config import Config
MCORD_KIND = "RAN" # This should be changed later I did it fo demo
+VNFM_KIND = "vEPC" # This should be changed later I did it fo demo
MCORD_USE_VTN = getattr(Config(), "networking_use_vtn", False)
VBBU_KIND = "RAN"
VSGW_KIND = "vSGW"
@@ -23,6 +24,77 @@
# The class to represent the service. Most of the service logic is given for us
# in the Service class but, we have some configuration that is specific for
# this example.
+class ProxyService(Service):
+ KIND = VNFM_KIND
+
+ class Meta:
+ # When the proxy field is set to True the model is represented as
+ # it's superclass in the database, but we can still change the python
+ # behavior. In this case HelloWorldServiceComplete is a Service in the
+ # database.
+ proxy = True
+ # The name used to find this service, all directories are named this
+ app_label = "mcord"
+ verbose_name = "MCORD VNFM Service"
+
+class VSGWTenant(Tenant):
+ class Meta:
+ proxy = True
+
+ KIND = VSGW_KIND
+
+ default_attributes = {"status": None, "action": None, "control": None, "extra": None}
+ def __init__(self, *args, **kwargs):
+ proxy_services = VNFMService.get_service_objects().all()
+ if volt_services:
+ self._meta.get_field("provider_service").default = proxy_services[0].id
+ super(VSGWTenant, self).__init__(*args, **kwargs)
+
+ @property
+ def status(self):
+ return self.get_attribute("status", self.default_attributes["status"])
+
+ @status.setter
+ def status(self, value):
+ self.set_attribute("status", value)
+
+ @property
+ def action(self):
+ return self.get_attribute("action", self.default_attributes["action"])
+
+ @action.setter
+ def action(self, value):
+ self.set_attribute("action", value)
+
+ @property
+ def control(self):
+ return self.get_attribute("control", self.default_attributes["control"])
+
+ @control.setter
+ def control(self, value):
+ self.set_attribute("control", value)
+
+ @property
+ def extra(self):
+ return self.get_attribute("extra", self.default_attributes["extra"])
+
+ @extra.setter
+ def extra(self, value):
+ self.set_attribute("extra", value)
+
+
+ def save(self, *args, **kwargs):
+
+ super(VSGWTenant, self).save(*args, **kwargs)
+ model_policy_mcord_service_component(self.pk)
+
+ def delete(self, *args, **kwargs):
+ super(VSGWTenant, self).delete(*args, **kwargs)
+
+
+# This is the class to represent the tenant. Most of the logic is given to use
+# in TenantWithContainer, however there is some configuration and logic that
+# we need to define for this example.
class MCORDService(Service):
KIND = MCORD_KIND
diff --git a/xos/services/mcord/models.py.old b/xos/services/mcord/models.py.old
deleted file mode 100644
index 611e990..0000000
--- a/xos/services/mcord/models.py.old
+++ /dev/null
@@ -1,289 +0,0 @@
-from django.db import models
-from core.models import Service, PlCoreBase, Slice, Instance, Tenant, TenantWithContainer, Node, Image, User, Flavor, Subscriber, NetworkParameter, NetworkParameterType, AddressPool, Port
-from core.models.plcorebase import StrippedCharField
-import os
-from django.db import models, transaction
-from django.forms.models import model_to_dict
-from django.db.models import Q
-from operator import itemgetter, attrgetter, methodcaller
-from core.models import Tag
-from core.models.service import LeastLoadedNodeScheduler
-import traceback
-from xos.exceptions import *
-from core.models import SlicePrivilege, SitePrivilege
-from sets import Set
-from xos.config import Config
-
-MCORD_KIND = "MCORD"
-MCORD_USE_VTN = getattr(Config(), "networking_use_vtn", False)
-VBBU_KIND = "vBBU"
-VSGW_KIND = "vSGW"
-VPGW_KIND = "vPGW"
-# some comment
-# The class to represent the service. Most of the service logic is given for us
-# in the Service class but, we have some configuration that is specific for
-# this example.
-class MCORDService(Service):
- KIND = MCORD_KIND
-
- class Meta:
- # When the proxy field is set to True the model is represented as
- # it's superclass in the database, but we can still change the python
- # behavior. In this case HelloWorldServiceComplete is a Service in the
- # database.
- proxy = True
- # The name used to find this service, all directories are named this
- app_label = "mcord"
- verbose_name = "MCORD Service"
-
-# This is the class to represent the tenant. Most of the logic is given to use
-# in TenantWithContainer, however there is some configuration and logic that
-# we need to define for this example.
-class VBBUComponent(TenantWithContainer):
-
- class Meta:
- # Same as a above, HelloWorldTenantComplete is represented as a
- # TenantWithContainer, but we change the python behavior.
- proxy = True
- verbose_name = "VBBU MCORD Service Component"
-
- # The kind of the service is used on forms to differentiate this service
- # from the other services.
- KIND = VBBU_KIND
-
- # Ansible requires that the sync_attributes field contain nat_ip and nat_mac
- # these will be used to determine where to SSH to for ansible.
- # Getters must be defined for every attribute specified here.
- sync_attributes = ("s1u_ip", "s1u_mac",
- "s1mme_ip", "s1mme_mac",
- "rru_ip", "rru_mac")
-
- # default_attributes is used cleanly indicate what the default values for
- # the fields are.
- default_attributes = {"display_message": "VBBU Component is ready!", "s1u_tag": "201", "s1mme_tag": "200", "rru_tag": "199"}
- def __init__(self, *args, **kwargs):
- mcord_services = MCORDService.get_service_objects().all()
- # When the tenant is created the default service in the form is set
- # to be the first created HelloWorldServiceComplete
- if mcord_services:
- self._meta.get_field(
- "provider_service").default = mcord_services[0].id
- super(VBBUComponent, self).__init__(*args, **kwargs)
-
- def can_update(self, user):
- #Allow creation of this model instances for non-admin users also
- return True
-
- def save(self, *args, **kwargs):
- if not self.creator:
- if not getattr(self, "caller", None):
- # caller must be set when creating a monitoring channel since it creates a slice
- raise XOSProgrammingError("ServiceComponents's self.caller was not set")
- self.creator = self.caller
- if not self.creator:
- raise XOSProgrammingError("ServiceComponents's self.creator was not set")
-
- super(VBBUComponent, self).save(*args, **kwargs)
- # This call needs to happen so that an instance is created for this
- # tenant is created in the slice. One instance is created per tenant.
- model_policy_mcord_servicecomponent(self.pk)
-
- def save_instance(self, instance):
- with transaction.atomic():
- super(VBBUComponent, self).save_instance(instance)
- if instance.isolation in ["vm"]:
- ntypes = ["s1u", "s1mme", "rru"]
- for i in range(len(ntypes)):
- ntype = ntypes[i]
- lan_network = self.get_lan_network(instance, ntype)
-# port = self.find_or_make_port(instance, lan_network)
- if ntype == "s1u":
- print "S1U_TAG", self.s1u_tag
- s1uport = self.find_or_make_port(instance, lan_network)
- s1uport.set_parameter("s_tag", self.s1u_tag)
- s1uport.set_parameter("neutron_port_name", "stag-%s" % self.s1u_tag)
- s1uport.save()
- elif ntype == "s1mme":
- print "MME_TAG", self.s1mme_tag
- mmeport = self.find_or_make_port(instance, lan_network)
- mmeport.set_parameter("s_tag", self.s1mme_tag)
- mmeport.set_parameter("neutron_port_name", "stag-%s" % self.s1mme_tag)
- mmeport.save()
- elif ntype == "rru":
- print "RRU_TAG", self.rru_tag
- rruport = self.find_or_make_port(instance, lan_network)
- rruport.set_parameter("s_tag", self.rru_tag)
- rruport.set_parameter("neutron_port_name", "stag-%s" % self.rru_tag)
- rruport.save()
-
- def delete(self, *args, **kwargs):
- # Delete the instance that was created for this tenant
- self.cleanup_container()
- super(VBBUComponent, self).delete(*args, **kwargs)
-
- def find_or_make_port(self, instance, network, **kwargs):
- port = Port.objects.filter(instance=instance, network=network)
- if port:
- port = port[0]
- else:
- port = Port(instance=instance, network=network, **kwargs)
- port.save()
- return port
-
- def get_lan_network(self, instance, ntype):
- slice = self.provider_service.slices.all()[0]
- lan_networks = [x for x in slice.networks.all() if ntype in x.name]
- if not lan_networks:
- raise XOSProgrammingError("No lan_network")
- return lan_networks[0]
-
- def manage_container(self):
- from core.models import Instance, Flavor
-
- if self.deleted:
- return
-
- # For container or container_vm isolation, use what TenantWithCotnainer
- # provides us
- slice = self.get_slice()
- if slice.default_isolation in ["container_vm", "container"]:
- super(VBBUComponent,self).manage_container()
- return
-
- if not self.s1u_tag:
- raise XOSConfigurationError("S1U_TAG is missed")
-
- if not self.s1mme_tag:
- raise XOSConfigurationError("S1U_TAG is missed")
-
- if not self.rru_tag:
- raise XOSConfigurationError("S1U_TAG is missed")
-
- if self.instance:
- # We're good.
- return
-
- instance = self.make_instance_for_s_tag(self.s1u_tag)
- self.instance = instance
- super(TenantWithContainer, self).save()
-
- def get_slice(self):
- if not self.provider_service.slices.count():
- raise XOSConfigurationError("The service has no slices")
- slice = self.provider_service.slices.all()[0]
- return slice
-
- def make_instance_for_s_tag(self, s_tag):
- slice = self.provider_service.slices.all()[0]
- flavors = Flavor.objects.filter(name=slice.default_flavor)
- if not flavors:
- raise XOSConfigurationError("No default flavor")
- default_flavor = slice.default_flavor
- slice = self.provider_service.slices.all()[0]
- if slice.default_isolation == "container_vm":
- (node, parent) = ContainerVmScheduler(slice).pick()
- else:
- (node, parent) = LeastLoadedNodeScheduler(slice).pick()
- instance = Instance(slice = slice,
- node = node,
- image = self.image,
- creator = self.creator,
- deployment = node.site_deployment.deployment,
- flavor = flavors[0],
- isolation = slice.default_isolation,
- parent = parent)
- self.save_instance(instance)
- return instance
-
- def ip_to_mac(self, ip):
- (a, b, c, d) = ip.split('.')
- return "02:42:%02x:%02x:%02x:%02x" % (int(a), int(b), int(c), int(d))
-
- # Getter for the message that will appear on the webpage
- # By default it is "Hello World!"
- @property
- def display_message(self):
- return self.get_attribute(
- "display_message",
- self.default_attributes['display_message'])
-
- @display_message.setter
- def display_message(self, value):
- self.set_attribute("display_message", value)
-
- @property
- def s1u_tag(self):
- return self.get_attribute(
- "s1u_tag",
- self.default_attributes['s1u_tag'])
-
- @s1u_tag.setter
- def s1u_tag(self, value):
- self.set_attribute("s1u_tag", value)
-
- @property
- def s1mme_tag(self):
- return self.get_attribute(
- "s1mme_tag",
- self.default_attributes['s1mme_tag'])
-
- @s1mme_tag.setter
- def s1mme_tag(self, value):
- self.set_attribute("s1mme_tag", value)
-
- @property
- def rru_tag(self):
- return self.get_attribute(
- "rru_tag",
- self.default_attributes['rru_tag'])
-
- @rru_tag.setter
- def rru_tag(self, value):
- self.set_attribute("rru_tag", value)
-
-
- @property
- def addresses(self):
- if (not self.id) or (not self.instance):
- return {}
-
- addresses = {}
- for ns in self.instance.ports.all():
- if "s1u" in ns.network.name.lower():
- addresses["s1u"] = (ns.ip, ns.mac)
- elif "s1mme" in ns.network.name.lower():
- addresses["s1mme"] = (ns.ip, ns.mac)
- elif "rru" in ns.network.name.lower():
- addresses["rru"] = (ns.ip, ns.mac)
- return addresses
-
-
- @property
- def s1u_ip(self):
- return self.addresses.get("s1u", (None, None))[0]
- @property
- def s1u_mac(self):
- return self.addresses.get("s1u", (None, None))[1]
- @property
- def s1mme_ip(self):
- return self.addresses.get("s1mme", (None, None))[0]
- @property
- def s1mme_mac(self):
- return self.addresses.get("s1mme", (None, None))[1]
- @property
- def rru_ip(self):
- return self.addresses.get("rru", (None, None))[0]
- @property
- def rru_mac(self):
- return self.addresses.get("rru", (None, None))[1]
-
-def model_policy_mcord_servicecomponent(pk):
- # This section of code is atomic to prevent race conditions
- with transaction.atomic():
- # We find all of the tenants that are waiting to update
- component = VBBUComponent.objects.select_for_update().filter(pk=pk)
- if not component:
- return
- # Since this code is atomic it is safe to always use the first tenant
- component = component[0]
- component.manage_container()
diff --git a/xos/services/mcord/models.py.old2 b/xos/services/mcord/models.py.old3
similarity index 92%
rename from xos/services/mcord/models.py.old2
rename to xos/services/mcord/models.py.old3
index 7e27a51..1b2bd65 100644
--- a/xos/services/mcord/models.py.old2
+++ b/xos/services/mcord/models.py.old3
@@ -14,9 +14,9 @@
from sets import Set
from xos.config import Config
-MCORD_KIND = "MCORD"
+MCORD_KIND = "RAN" # This should be changed later I did it fo demo
MCORD_USE_VTN = getattr(Config(), "networking_use_vtn", False)
-VBBU_KIND = "vBBU"
+VBBU_KIND = "RAN"
VSGW_KIND = "vSGW"
VPGW_KIND = "vPGW"
net_types = ("s1u", "s1mme", "rru")
@@ -59,7 +59,7 @@
"rru_ip", "rru_mac")
# default_attributes is used cleanly indicate what the default values for
# the fields are.
- default_attributes = {"display_message": "VBBU Component is ready!", "s1u_tag": "201", "s1mme_tag": "200", "rru_tag": "199"}
+ default_attributes = {"display_message": "New vBBU Component", "s1u_tag": "901", "s1mme_tag": "900", "rru_tag": "999"}
def __init__(self, *args, **kwargs):
mcord_services = MCORDService.get_service_objects().all()
# When the tenant is created the default service in the form is set
@@ -98,14 +98,14 @@
port.set_parameter("s_tag", self.s1u_tag)
port.set_parameter("neutron_port_name", "stag-%s" % self.s1u_tag)
port.save()
-# elif (ntype == "s1mme"):
-# port.set_parameter("s_tag", self.s1mme_tag)
-# port.set_parameter("neutron_port_name", "stag-%s" % self.s1mme_tag)
-# port.save()
-# elif (ntype == "rru"):
-# port.set_parameter("s_tag", self.rru_tag)
-# port.set_parameter("neutron_port_name", "stag-%s" % self.rru_tag)
-# port.save()
+ elif (ntype == "s1mme"):
+ port.set_parameter("s_tag", self.s1mme_tag)
+ port.set_parameter("neutron_port_name", "stag-%s" % self.s1mme_tag)
+ port.save()
+ elif (ntype == "rru"):
+ port.set_parameter("s_tag", self.rru_tag)
+ port.set_parameter("neutron_port_name", "stag-%s" % self.rru_tag)
+ port.save()
def delete(self, *args, **kwargs):
# Delete the instance that was created for this tenant
@@ -156,7 +156,7 @@
# We're good.
return
- instance = self.make_instance(self)
+ instance = self.make_instance()
self.instance = instance
super(TenantWithContainer, self).save()
@@ -169,6 +169,7 @@
def make_instance(self):
slice = self.provider_service.slices.all()[0]
flavors = Flavor.objects.filter(name=slice.default_flavor)
+# flavors = Flavor.objects.filter(name="m1.xlarge")
if not flavors:
raise XOSConfigurationError("No default flavor")
default_flavor = slice.default_flavor
diff --git a/xos/synchronizers/vnfm/model-deps b/xos/synchronizers/vnfm/model-deps
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/xos/synchronizers/vnfm/model-deps
@@ -0,0 +1 @@
+{}
diff --git a/xos/synchronizers/vnfm/run.sh b/xos/synchronizers/vnfm/run.sh
new file mode 100755
index 0000000..81cd4d4
--- /dev/null
+++ b/xos/synchronizers/vnfm/run.sh
@@ -0,0 +1,2 @@
+export XOS_DIR=/opt/xos
+python vnfm-synchronizer.py -C $XOS_DIR/synchronizers/vnfm/vnfm_synchronizer_config
diff --git a/xos/synchronizers/vnfm/start.sh b/xos/synchronizers/vnfm/start.sh
new file mode 100755
index 0000000..5a61e1a
--- /dev/null
+++ b/xos/synchronizers/vnfm/start.sh
@@ -0,0 +1,2 @@
+export XOS_DIR=/opt/xos
+nohup python vnfm-synchronizer.py -C $XOS_DIR/synchronizers/vnfm/vnfm_synchronizer_config > /dev/null 2>&1 &
diff --git a/xos/synchronizers/vnfm/steps/sync_tasks.py b/xos/synchronizers/vnfm/steps/sync_tasks.py
new file mode 100644
index 0000000..fb8988e
--- /dev/null
+++ b/xos/synchronizers/vnfm/steps/sync_tasks.py
@@ -0,0 +1,134 @@
+import os
+import requests
+import socket
+import sys
+import base64
+from django.db.models import F, Q
+from xos.config import Config
+from synchronizers.base.syncstep import SyncStep
+from core.models import Service, Port, Controller, Tag
+from core.models.service import COARSE_KIND
+from services.cord.models import VSGWTenant
+from services.cord.models import Tenant
+from xos.logger import Logger, logging
+from requests.auth import HTTPBasicAuth
+
+# hpclibrary will be in steps/..
+parentdir = os.path.join(os.path.dirname(__file__),"..")
+sys.path.insert(0,parentdir)
+
+logger = Logger(level=logging.INFO)
+
+# XXX should save and load this
+glo_saved_vtn_maps = []
+
+class SyncTasks(SyncStep):
+ requested_interval = 0 # 3600
+ provides=[Task]
+ observes=Task
+
+ def __init__(self, **args):
+ SyncStep.__init__(self, **args)
+
+ def call(self, **args):
+ global glo_saved_vtn_maps
+
+ logger.info("sync'ing vsg tenant to port addresses")
+
+ # build up a dictionary of port-->[wan_addrs] mappings
+ tasks_todo = {}
+ for vsg in VSGTenant.get_tenant_objects().all():
+ if not vsg.instance:
+ logger.info("skipping vsg %s because it has no instance" % vsg)
+
+ wan_ip = vsg.wan_container_ip
+ if not wan_ip:
+ logger.info("skipping vsg %s because it has no wan_container_ip" % vsg)
+
+ wan_mac = vsg.wan_container_mac
+ if not wan_mac:
+ logger.info("skipping vsg %s because it has no wan_container_mac" % vsg)
+
+ lan_network = vsg.get_lan_network(vsg.instance)
+ if not lan_network:
+ logger.info("skipping vsg %s because it has no lan_network" % vsg)
+
+ lan_port = Port.objects.filter(instance = vsg.instance, network=lan_network)
+ if not lan_port:
+ logger.info("skipping vsg %s because it has no lan_port" % vsg)
+ lan_port = lan_port[0]
+
+ if not lan_port.port_id:
+ logger.info("skipping vsg %s because its lan_port has no port_id" % vsg)
+
+ if not (lan_port.pk in port_addrs):
+ port_addrs[lan_port.pk] = []
+ entry = {"mac_address": wan_mac, "ip_address": wan_ip}
+ addr_pairs = port_addrs[lan_port.pk]
+ if not entry in addr_pairs:
+ addr_pairs.append(entry)
+
+ # now do the VM_WAN_IP from the instance
+ if vsg.instance:
+ wan_vm_ip = vsg.wan_vm_ip
+ wan_vm_mac = vsg.wan_vm_mac
+ entry = {"mac_address": wan_vm_mac, "ip_address": wan_vm_ip}
+ if not entry in addr_pairs:
+ addr_pairs.append(entry)
+
+ # Get all ports in all controllers
+ ports_by_id = {}
+ for controller in Controller.objects.all():
+ if not controller.admin_tenant:
+ logger.info("controller %s has no admin_tenant" % controller)
+ continue
+ try:
+ driver = self.driver.admin_driver(controller = controller)
+ ports = driver.shell.quantum.list_ports()["ports"]
+ except:
+ logger.log_exc("failed to get ports from controller %s" % controller)
+ continue
+
+ for port in ports:
+ ports_by_id[port["id"]] = port
+
+ for port_pk in port_addrs.keys():
+ port = Port.objects.get(pk=port_pk)
+ addr_pairs = port_addrs[port_pk]
+ neutron_port = ports_by_id.get(port.port_id,None)
+ if not neutron_port:
+ logger.info("failed to get neutron port for port %s" % port)
+ continue
+
+ ips = [x["ip_address"] for x in addr_pairs]
+
+ changed = False
+
+ # delete addresses in neutron that don't exist in XOS
+ aaps = neutron_port.get("allowed_address_pairs", [])
+ for aap in aaps[:]:
+ if not aap["ip_address"] in ips:
+ logger.info("removing address %s from port %s" % (aap["ip_address"], port))
+ aaps.remove(aap)
+ changed = True
+
+ aaps_ips = [x["ip_address"] for x in aaps]
+
+ # add addresses in XOS that don't exist in neutron
+ for addr in addr_pairs:
+ if not addr["ip_address"] in aaps_ips:
+ logger.info("adding address %s to port %s" % (addr, port))
+ aaps.append( addr )
+ aaps_ips.append(addr["ip_address"])
+ changed = True
+
+ if changed:
+ logger.info("updating port %s" % port)
+ driver.shell.quantum.update_port(port.port_id, {"port": {"allowed_address_pairs": aaps}})
+
+
+
+
+
+
+
diff --git a/xos/synchronizers/vnfm/steps/sync_tenant.py b/xos/synchronizers/vnfm/steps/sync_tenant.py
new file mode 100644
index 0000000..4dfa177
--- /dev/null
+++ b/xos/synchronizers/vnfm/steps/sync_tenant.py
@@ -0,0 +1,95 @@
+import os
+import requests
+import socket
+import sys
+import base64
+from django.db.models import F, Q
+from xos.config import Config
+from synchronizers.base.syncstep import SyncStep
+from core.models import Service
+from core.models.service import COARSE_KIND
+from services.cord.models import Tenant
+from xos.logger import Logger, logging
+from requests.auth import HTTPBasicAuth
+
+# hpclibrary will be in steps/..
+parentdir = os.path.join(os.path.dirname(__file__),"..")
+sys.path.insert(0,parentdir)
+
+logger = Logger(level=logging.INFO)
+
+# XXX should save and load this
+glo_saved_vtn_maps = []
+
+class SyncVSGWTenant(SyncStep):
+ provides=[Tenant]
+ observes=Tenant
+ requested_interval=0
+
+ def __init__(self, **args):
+ SyncStep.__init__(self, **args)
+
+ def get_vnfm_service(self):
+# vtn_tenant = Tenant.objects.filter(name="VTN_ONOS_app") # XXX fixme - hardcoded
+# if not vtn_tenant:
+# raise "No VTN Onos App found"
+# vtn_tenant = vtn_tenant[0]
+#
+# vtn_service = vtn_tenant.provider_service
+ vnfm_service = Service.objects.filter(name="service_vnfm") # XXX fixme - harcoded
+ if not vtn_service:
+ raise "No VNFM Service"
+
+ return vnfm_service[0]
+
+ def get_vnfm_params(self):
+ vnfm_service = self.get_vnfm_vsgw_service()
+
+ if not vnfm_service.slices.exists():
+ raise "VNFM Service has no slices"
+
+ vnfm_slice = vnfm_service.slices.all()[0]
+
+ if not vnfm_slice.instances.exists():
+ raise "VNFM Slice has no instances"
+
+ vnfm_instance = vnfm_slice.instances.all()[0]
+
+ return vnfm_instance.node.name
+
+ def call(self, **args):
+ global glo_saved_vtn_maps
+
+ logger.info("sync'ing vtn services")
+
+ vtn_maps = []
+ for service in Service.objects.all():
+ for id in service.get_vtn_src_ids():
+ dependencies = service.get_vtn_dependencies_ids()
+ if dependencies:
+ for dependency in dependencies:
+ vtn_maps.append( (id, dependency) )
+
+ for vtn_map in vtn_maps:
+ if not (vtn_map in glo_saved_vtn_maps):
+ # call vtn rest api to add map
+ url = "http://" + self.get_vtn_addr() + ":8181/vnfm/rest-api-url/service-dependency/%s/%s" % (vtn_map[0], vtn_map[1])
+
+ print "POST %s" % url
+ r = requests.post(url, auth=HTTPBasicAuth('karaf', 'karaf') ) # XXX fixme - hardcoded auth
+ if (r.status_code != 200):
+ raise Exception("Received error from vtn service (%d)" % r.status_code)
+
+ for vtn_map in glo_saved_vtn_maps:
+ if not vtn_map in vtn_maps:
+ # call vtn rest api to delete map
+ url = "http://" + self.get_vtn_addr() + ":8181/vnfm/rest-api-url/service-dependency/%s/%s" % (vtn_map[0],vtn_map[1])
+
+ print "DELETE %s" % url
+ r = requests.delete(url, auth=HTTPBasicAuth('karaf', 'karaf') ) # XXX fixme - hardcoded auth
+ if (r.status_code != 200):
+ raise Exception("Received error from vtn service (%d)" % r.status_code)
+
+ glo_saved_vtn_maps = vtn_maps
+ # TODO: save this
+
diff --git a/xos/synchronizers/vnfm/stop.sh b/xos/synchronizers/vnfm/stop.sh
new file mode 100755
index 0000000..64ccd03
--- /dev/null
+++ b/xos/synchronizers/vnfm/stop.sh
@@ -0,0 +1 @@
+pkill -9 -f vnfm-synchronizer.py
diff --git a/xos/synchronizers/vnfm/supervisor/vtn-observer.conf b/xos/synchronizers/vnfm/supervisor/vtn-observer.conf
new file mode 100644
index 0000000..714afa7
--- /dev/null
+++ b/xos/synchronizers/vnfm/supervisor/vtn-observer.conf
@@ -0,0 +1,2 @@
+[program:vtn-observer]
+command=python /opt/xos/observers/vbng/vtn-observer.py -C /opt/xos/observers/vbng/vtn_observer_config
diff --git a/xos/synchronizers/vnfm/vnfm-synchronizer.py b/xos/synchronizers/vnfm/vnfm-synchronizer.py
new file mode 100755
index 0000000..84bec4f
--- /dev/null
+++ b/xos/synchronizers/vnfm/vnfm-synchronizer.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+# This imports and runs ../../xos-observer.py
+
+import importlib
+import os
+import sys
+observer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../synchronizers/base")
+sys.path.append(observer_path)
+mod = importlib.import_module("xos-synchronizer")
+mod.main()
diff --git a/xos/synchronizers/vnfm/vnfm_synchronizer_config b/xos/synchronizers/vnfm/vnfm_synchronizer_config
new file mode 100644
index 0000000..55594e2
--- /dev/null
+++ b/xos/synchronizers/vnfm/vnfm_synchronizer_config
@@ -0,0 +1,44 @@
+
+[plc]
+name=plc
+deployment=VICCI
+
+[db]
+name=xos
+user=postgres
+password=password
+host=localhost
+port=5432
+
+[api]
+host=128.112.171.237
+port=8000
+ssl_key=None
+ssl_cert=None
+ca_ssl_cert=None
+ratelimit_enabled=0
+omf_enabled=0
+mail_support_address=support@localhost
+nova_enabled=True
+
+[observer]
+name=vnfm
+dependency_graph=/opt/xos/synchronizers/vnfm/model-deps
+steps_dir=/opt/xos/synchronizers/vnfm/steps
+sys_dir=/opt/xos/synchronizers/vnfm/sys
+deleters_dir=/opt/xos/synchronizers/vnfm/deleters
+log_file=console
+#/var/log/hpc.log
+driver=openstack
+pretend=False
+backoff_disabled=True
+
+[nova]
+ca_ssl_cert=/etc/ssl/certs/ca-certificates.crt
+
+[feefie]
+client_id='vicci_dev_central'
+user_id='pl'
+
+[networking]
+use_vtn=True