- "Creating flavor with name: '%s'", self.flavor_name)
- scenario = env.get('DEPLOY_SCENARIO')
- flavor_metadata = None
- flavor_ram = 512
- if 'ovs' in scenario or 'fdio' in scenario:
- flavor_metadata = create_flavor.MEM_PAGE_SIZE_LARGE
- flavor_ram = 1024
- flavor_creator = OpenStackFlavor(
- self.os_creds,
- FlavorConfig(name=self.flavor_name, ram=flavor_ram, disk=1,
- vcpus=1, metadata=flavor_metadata))
- flavor_creator.create()
- self.creators.append(flavor_creator)
+ "Creating flavor with name: '%s'", flavor_name)
+ self.flavor = self.cloud.create_flavor(
+ flavor_name, getattr(config.CONF, 'openstack_flavor_ram'),
+ getattr(config.CONF, 'openstack_flavor_vcpus'),
+ getattr(config.CONF, 'openstack_flavor_disk'))
+ self.logger.debug("flavor: %s", self.flavor)
+ self.cloud.set_flavor_specs(
+ self.flavor.id, getattr(config.CONF, 'flavor_extra_specs', {}))
+
+ self.sec1 = self.cloud.create_security_group(
+ getattr(config.CONF, 'vping_sg_name') + self.guid,
+ getattr(config.CONF, 'vping_sg_desc'))
+ self.cloud.create_security_group_rule(
+ self.sec1.id, protocol='icmp', direction='ingress')
+
+ vm1_name = getattr(config.CONF, 'vping_vm_name_1') + self.guid
+ self.logger.info(
+ "Creating VM 1 instance with name: '%s'", vm1_name)
+ self.vm1 = self.cloud.create_server(
+ vm1_name, image=self.image.id,
+ flavor=self.flavor.id,
+ auto_ip=False, wait=True,
+ timeout=getattr(config.CONF, 'vping_vm_boot_timeout'),
+ network=self.network.id,
+ security_groups=[self.sec1.id])
+ self.logger.debug("vm1: %s", self.vm1)
+ self.vm1 = self.cloud.wait_for_server(self.vm1, auto_ip=False)
+ p_console = self.cloud.get_server_console(self.vm1.id)
+ self.logger.debug("vm1 console: \n%s", p_console)