Exemplo n.º 1
0
    glob_logger.error(
        "Must supply --{} or have value in environment".format(m))
    raise ArgumentError("Argument {} not supplied for credentials".format(m))

numa = NUMA(**creds)  # Create a NUMA object
numa.clean()  # make sure we have a clean system

# Create a new flavor that will have the extra specs we need
numa_flavor = numa.create_flavor("numa_flavor",
                                 ram=ram,
                                 vcpus=vcpus,
                                 disksize=disk,
                                 specs=None)

# Modify the flavor with the appropriate extra_specs
numa_flavor = numa.create_numa_topo_extra_specs(flv=numa_flavor, numa_nodes=1)

# Now we have a flavor with 2 NUMA nodes defined.  You can display the extra_specs
extra_specs = numa_flavor.get_keys()
glob_logger.info(str(extra_specs))

# Now that we have a flavor with a simple numa topology defined, we can boot an instance.
# Note that the flavor that was defined only specified 1 NUMA nodes and a memory policy of
# preferred.  There are many additional permutations that can be done, such as having asymmetrical
# cpus to to NUMA nodes, asymmetrical memory to NUMA nodes, or combining NUMA topology with
# vcpu pinning or large page memory support
image = numa.get_image_name("cirros")
instance = numa.boot_instance(img=image, flv=numa_flavor, name="numa_instance")

# Poll to see when the instance is done booting up
active = smog.nova.poll_status(instance, "ACTIVE", timeout=600)
Exemplo n.º 2
0
auth_url = args.auth_url
password = args.password
creds = {"username": username, "tenant_name": tenant_name, "auth_url": auth_url, "password": password}
missing = [k for k, v in creds.items() if v is None]
for m in missing:
    glob_logger.error("Must supply --{} or have value in environment".format(m))
    raise ArgumentError("Argument {} not supplied for credentials".format(m))

numa = NUMA(**creds)  # Create a NUMA object
numa.clean()  # make sure we have a clean system

# Create a new flavor that will have the extra specs we need
numa_flavor = numa.create_flavor("numa_flavor", ram=ram, vcpus=vcpus, disksize=disk, specs=None)

# Modify the flavor with the appropriate extra_specs
numa_flavor = numa.create_numa_topo_extra_specs(flv=numa_flavor, numa_nodes=1)

# Now we have a flavor with 2 NUMA nodes defined.  You can display the extra_specs
extra_specs = numa_flavor.get_keys()
glob_logger.info(str(extra_specs))

# Now that we have a flavor with a simple numa topology defined, we can boot an instance.
# Note that the flavor that was defined only specified 1 NUMA nodes and a memory policy of
# preferred.  There are many additional permutations that can be done, such as having asymmetrical
# cpus to to NUMA nodes, asymmetrical memory to NUMA nodes, or combining NUMA topology with
# vcpu pinning or large page memory support
image = numa.get_image_name("cirros")
instance = numa.boot_instance(img=image, flv=numa_flavor, name="numa_instance")

# Poll to see when the instance is done booting up
active = smog.nova.poll_status(instance, "ACTIVE", timeout=600)