Esempio n. 1
0
    dest = "root@{}:/etc/nova/nova.conf".format(cmpt)
    res = scp(src, dest)

    # TODO: Add the NUMATopologyFilter to the default_scheduler_filter list
    nova_conf = get_nova_conf(host)
    lines = get_cfg("scheduler_default_filters", nova_conf)
    lines_ = list(filter(lambda l: l.comment is None, lines))
    if not lines_:
        glob_logger.error("Unable to get")

    # restart nova
    pci.openstack_service(cmpt, "restart", "nova")


# Setup example
creds = read_rc_file(args.server, "/root/keystonerc_admin")

# Now, we create a PCI flavor and attempt to boot
numa = NUMA(**creds)
flv = numa.create_flavor("pci_small", ram=512, vcpus=1)
pci_pass_flv = numa.create_pci_flavor(alias_name, flv=flv)
glob_logger.info(str(pci_pass_flv.get_keys()))

guest = numa.boot_instance(flv=pci_pass_flv, name="pci-testing")
instance = numa.discover(guests=[guest])[0]

# TODO verify the instance is actually using
xmldump = instance.dumpxml()
dump = untangle.parse(xmldump)