- self.__logger.info("Deployed Orchestrator")
- private_net_name = getattr(
- CONST, 'vnf_{}_private_net_name'.format(self.case_name))
- private_subnet_name = getattr(
- CONST, 'vnf_{}_private_subnet_name'.format(self.case_name))
- private_subnet_cidr = getattr(
- CONST, 'vnf_{}_private_subnet_cidr'.format(self.case_name))
- abot_router = getattr(
- CONST, 'vnf_{}_external_router'.format(self.case_name))
-
- self.__logger.info("Creating full network ...")
- subnet_settings = SubnetConfig(
- name=private_subnet_name, cidr=private_subnet_cidr)
- network_settings = NetworkConfig(
- name=private_net_name, subnet_settings=[subnet_settings])
- network_creator = OpenStackNetwork(self.snaps_creds, network_settings)
- net_id = network_creator.create().id
- self.created_object.append(network_creator)
-
- ext_net_name = snaps_utils.get_ext_net_name(self.snaps_creds)
- self.__logger.info("Creating network Router ....")
- router_creator = OpenStackRouter(
- self.snaps_creds, RouterConfig(
- name=abot_router,
- external_gateway=ext_net_name,
- internal_subnets=[subnet_settings.name]))
- router_creator.create()
- self.created_object.append(router_creator)
- self.__logger.info("Creating Flavor ....")
- flavor_settings = FlavorConfig(
- name=self.orchestrator['requirements']['flavor']['name'],
- ram=self.orchestrator['requirements']['flavor']['ram_min'],
- disk=10, vcpus=1)
- flavor_creator = OpenStackFlavor(self.snaps_creds, flavor_settings)
- flavor_creator.create()
- self.created_object.append(flavor_creator)
- self.__logger.info("Upload some OS images if it doesn't exist")
- images = get_config("tenant_images", self.config_file)
- self.__logger.info("Images needed for vEPC: %s", images)
- for image_name, image_file in images.iteritems():
- self.__logger.info("image: %s, file: %s", image_name, image_file)
- if image_file and image_name:
- image_creator = OpenStackImage(self.snaps_creds, ImageConfig(
- name=image_name, image_user='cloud', img_format='qcow2',
- image_file=image_file))
- image_id = image_creator.create().id
- os.system(
- 'juju metadata generate-image -d ~ -i {} -s {} -r '
- '{} -u {}'.format(
- image_id, image_name,
- os.environ.get(
- "OS_REGION_NAME", self.default_region_name),
- self.public_auth_url))
- self.created_object.append(image_creator)
- self.__logger.info("Credential information : %s", net_id)
- juju_bootstrap_command = (
- 'juju bootstrap abot-epc abot-controller --config network={} '
- '--metadata-source ~ --config ssl-hostname-verification=false '