Re: [ovirt-users] Ovirt 4.2 - Help adding VM to numa node via python SDK
HI Yaniv I looked at your reference and it looks like I have almost the same thing, but I was looking to take it a step further with virtual numa node. Is it necessary to really do it for extra performance? Below is my code snippet, it is not cleaned up yet, but works. I am also looking at programatically added host devices such as a GPU. Do you have an example of doing that? # Get the "vms" service vms_service = connection.system_service().vms_service() # Create vm vms_service.add( types.Vm( name='test', type=types.VmType('high_performance'), memory=20 * 2**30, memory_policy=types.MemoryPolicy(guaranteed=20 * 2**30, ballooning=False, max=20 * 2**30), os=types.OperatingSystem(boot=types.Boot(devices=[types.BootDevice.NETWORK, types.BootDevice.HD]), type='LINUX'), #time_zone=types.TimeZone('GMT-06:00'), numa_tune_mode=types.NumaTuneMode('preferred'), io=types.Io(threads=1), cpu=types.Cpu(topology=types.CpuTopology(cores=1, sockets=4, threads=1), mode=types.CpuMode('host_passthrough'), cpu_tune=types.CpuTune(vcpu_pins=[types.VcpuPin('24', 0), types.VcpuPin('25', 1), types.VcpuPin('26', 2), types.VcpuPin('27', 3)])), placement_policy=types.VmPlacementPolicy(affinity=types.VmAffinity('pinned'), hosts=[types.Host(name='lab5')]), custom_properties=[types.CustomProperty('hugepages', 'hugepages', '1048576')], cluster=types.Cluster( name='lab5-Local', ), template=types.Template( name='Blank', ), ), ) Thanks Don On Fri, Jan 26, 2018 at 11:04 AM, Yaniv Kaulwrote: > > > On Wed, Jan 24, 2018 at 11:18 PM, Don Dupuis wrote: > >> I am able to create a vm using the sdk with nic and disks using the >> python sdk, but having trouble understanding how to assign it to virtual >> numanode onto the physical numanode via python sdk. Any help in this area >> would be greatly appreciated >> > > Please see line 165 @ [1], I think it's what you are looking for. > Y. > > [1] https://gerrit.ovirt.org/#/c/86715/3/basic-suite-master/ > test-scenarios/004_basic_sanity.py > > >> >> Thanks >> >> Don >> >> ___ >> Users mailing list >> Users@ovirt.org >> http://lists.ovirt.org/mailman/listinfo/users >> >> > ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
Re: [ovirt-users] Ovirt 4.2 - Help adding VM to numa node via python SDK
On Wed, Jan 24, 2018 at 11:18 PM, Don Dupuiswrote: > I am able to create a vm using the sdk with nic and disks using the python > sdk, but having trouble understanding how to assign it to virtual numanode > onto the physical numanode via python sdk. Any help in this area would be > greatly appreciated > Please see line 165 @ [1], I think it's what you are looking for. Y. [1] https://gerrit.ovirt.org/#/c/86715/3/basic-suite-master/test-scenarios/004_basic_sanity.py > > Thanks > > Don > > ___ > Users mailing list > Users@ovirt.org > http://lists.ovirt.org/mailman/listinfo/users > > ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
[ovirt-users] Ovirt 4.2 - Help adding VM to numa node via python SDK
I am able to create a vm using the sdk with nic and disks using the python sdk, but having trouble understanding how to assign it to virtual numanode onto the physical numanode via python sdk. Any help in this area would be greatly appreciated Thanks Don ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
Re: [ovirt-users] Ovirt 4.2 - Help adding VM to numa node via python SDK
Thanks Andrej. I will use this information and see how far I get. Don On Thu, Jan 25, 2018 at 10:39 AM, Andrej Krejcirwrote: > Hi, > > The VirtualNumaNode[1] object has 'numa_node_pins' member, that is a list > of NumaNodePin[2]. > Most of the members of NumaNodePin object are deprecated and not used. > The important one is 'index', which is the index of the host numa node to > which the > vm numa node is pinned. Here is the REST API documentation: [3]. > > A simple python example can be: > > > import ovirtsdk4 as sdk > > conn = sdk.Connection("URL", "admin@internal", "PASSWORD") > > host_node = conn.service("hosts/123/numanodes/456").get() > > vm_node_service = conn.service("vms/789/numanodes/123") > vm_node = vm_node_service.get() > > vm_node.numa_node_pins = [ sdk.types.NumaNodePin(index=host_node.index, > pinned=True) ] > > vm_node_service.put(vm_node) > > > Andrej > > [1] - http://ovirt.github.io/ovirt-engine-sdk/master/types.m. > html#ovirtsdk4.types.VirtualNumaNode > [2] - http://ovirt.github.io/ovirt-engine-sdk/master/types.m. > html#ovirtsdk4.types.NumaNodePin > > [3] - http://ovirt.github.io/ovirt-engine-api-model/4.2/#types/ > numa_node_pin > > On 25 January 2018 at 16:12, Don Dupuis wrote: > >> I am able to create a vm using the sdk with nic and disks using the >> python sdk, but having trouble understanding how to assign it to virtual >> numanode onto the physical numanode via python sdk. Any help in this area >> would be greatly appreciated >> >> Thanks >> >> Don >> >> ___ >> Users mailing list >> Users@ovirt.org >> http://lists.ovirt.org/mailman/listinfo/users >> >> > ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
Re: [ovirt-users] Ovirt 4.2 - Help adding VM to numa node via python SDK
Hi, The VirtualNumaNode[1] object has 'numa_node_pins' member, that is a list of NumaNodePin[2]. Most of the members of NumaNodePin object are deprecated and not used. The important one is 'index', which is the index of the host numa node to which the vm numa node is pinned. Here is the REST API documentation: [3]. A simple python example can be: import ovirtsdk4 as sdk conn = sdk.Connection("URL", "admin@internal", "PASSWORD") host_node = conn.service("hosts/123/numanodes/456").get() vm_node_service = conn.service("vms/789/numanodes/123") vm_node = vm_node_service.get() vm_node.numa_node_pins = [ sdk.types.NumaNodePin(index=host_node.index, pinned=True) ] vm_node_service.put(vm_node) Andrej [1] - http://ovirt.github.io/ovirt-engine-sdk/master/types.m.html#ovirtsdk4.types.VirtualNumaNode [2] - http://ovirt.github.io/ovirt-engine-sdk/master/types.m.html#ovirtsdk4.types.NumaNodePin [3] - http://ovirt.github.io/ovirt-engine-api-model/4.2/#types/numa_node_pin On 25 January 2018 at 16:12, Don Dupuiswrote: > I am able to create a vm using the sdk with nic and disks using the python > sdk, but having trouble understanding how to assign it to virtual numanode > onto the physical numanode via python sdk. Any help in this area would be > greatly appreciated > > Thanks > > Don > > ___ > Users mailing list > Users@ovirt.org > http://lists.ovirt.org/mailman/listinfo/users > > ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
[ovirt-users] Ovirt 4.2 - Help adding VM to numa node via python SDK
I am able to create a vm using the sdk with nic and disks using the python sdk, but having trouble understanding how to assign it to virtual numanode onto the physical numanode via python sdk. Any help in this area would be greatly appreciated Thanks Don ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users