Earlier  
Posted Nick Remark
#openstack-nova - 2020-10-23
12:35:37 sean-k-mooney recyclehero: also people have proposed overcommiting PCPUs in the past but we have rejected it so its obvious but not to eveyone :)
12:36:13 recyclehero i have 1000 cpus, deal with it nova! :D
12:36:44 sean-k-mooney :)
12:37:08 recyclehero I didnt understnd the flavor part? how is it related with me not having allocation_ratio*PCPU=VCPUs?
12:37:36 sean-k-mooney i was wondering was this related to schduling but your actully asking about horizon right
12:37:51 sean-k-mooney horizon pull its infor from the hypervios api
12:38:28 recyclehero aha so if I even be successful with overcommiting via placement I dont get to see it in horizon
12:39:59 sean-k-mooney https://docs.openstack.org/api-ref/compute/?expanded=list-hypervisors-details-detail,show-hypervisor-statistics-detail#list-hypervisors-details
12:40:21 sean-k-mooney so it s either hitting the details endpoint or the stats endpoint
12:40:35 sean-k-mooney in both cases it just reports the vcpus i belive
12:41:11 sean-k-mooney that value is not multiplied by the allocation ratio
12:41:27 recyclehero so its actually PCPUs right?
12:41:40 sean-k-mooney well no PCPUs are a different thing
12:41:45 recyclehero The number of vcpu in this hypervisor. This does not take allocation ratios used for overcommit into account so there may be disparity between this and the used count.
12:42:33 recyclehero "VCPU = PCPU - reserverd" or am I completely wrong
12:42:39 sean-k-mooney it either the number of cpus on the host or it the number of cpu in the host defined by the vcpu_pin_set or cpu_shared_set
12:42:58 sean-k-mooney recyclehero: its not calulated that way
12:43:39 sean-k-mooney if you use cpu_dedicated_set and dont defien cpu_shared_set then vcpu=0
12:44:33 sean-k-mooney if you use cpu_shared_set or vcpu_pin_set and dont use cpu_dedicated_set then pcpus are 0
12:45:59 recyclehero sean-k-mooney: aha, but actually I dont care what I see in horzion. I have 8 cores which I am seeing in horizon. I need 128 cores ready for allocation.
12:46:01 recyclehero https://docs.openstack.org/placement/latest/user/index.html
12:46:03 sean-k-mooney recyclehero: stephenfin has a short blog on the topic https://that.guru/blog/cpu-resources-redux/
12:46:42 sean-k-mooney recyclehero: by the way we normally don suggest setting allocation raitos over 4
12:46:59 sean-k-mooney im planning to push a patch to change the inital allcoation ration to 4 next week
12:47:14 sean-k-mooney ill be bringin it up at the ptg
12:47:21 sean-k-mooney but back to your issue
12:47:28 sean-k-mooney can you check what is set in placment
12:47:33 recyclehero ok 4 will even do. but I will be rather be typing virt command with allocation ratio 1
12:47:56 recyclehero how? api cli?
12:48:06 sean-k-mooney you can do it either way
12:48:16 sean-k-mooney there is an osc-placment plugin for the openstack client
12:48:23 sean-k-mooney so you can pip install that
12:48:56 sean-k-mooney openstack --os-placement-api-version 1.18 resource provider list
12:49:17 sean-k-mooney then openstack --os-placement-api-version 1.18 resource provider inventory show <uuid of host> VCPU
12:49:17 recyclehero openstack resource provider inventory show c8ac01e1-0b52-41f0-bd52-484070ea3aa9 VCPU
12:49:27 recyclehero allocation_ratio | 16.0
12:49:36 recyclehero total | 8
12:49:40 sean-k-mooney there you go
12:49:50 noonedeadpunk sean-k-mooney: oh, btw, if we're talking about this:) Is usage of initial_*_allocation_ratio can be considered as unified and recommended approach instead of *_allocation_ratio?
12:50:27 sean-k-mooney noonedeadpunk: it depends on if you want to manage it via config or api
12:50:54 sean-k-mooney noonedeadpunk: some operators like to commit there configuration to git so want to use *allocation_ratio
12:51:09 sean-k-mooney other want to manage it via the api so shoudl use initail_*
12:51:13 sean-k-mooney to set the defualt
12:51:29 sean-k-mooney that basically how you chose between them
12:51:38 noonedeadpunk sean-k-mooney: just of the docs it seems that the idea of initial was thet it can be stored in git but can be overriden in api?
12:51:54 noonedeadpunk ah, I guess I see what you mean...
12:52:14 sean-k-mooney noonedeadpunk: yes it will set the inital value in the config and then over write it
12:52:22 recyclehero noonedeadpunk: https://review.opendev.org/#/c/758029/ we have takeled with jrosser and came to this. there are 2 refrence to related documentaion part.
12:52:26 sean-k-mooney inital is only used when creating an inventory for the first time
12:52:29 recyclehero https://docs.openstack.org/nova/ussuri/admin/configuration/schedulers.html#usage-scenarios
12:52:50 noonedeadpunk sean-k-mooney: aha, ok, I missed that part I guess
12:52:55 sean-k-mooney *_allocation_ration take efect every time the resouce tracker periodic task runs
12:53:34 noonedeadpunk so like if initial_ is overriden during runtime, it won't be really apllied
12:53:44 recyclehero if resource_tracker.py dont found the host it will set its inital flag to true
12:53:47 noonedeadpunk well, not during runtime, but after host is discovered
12:54:56 sean-k-mooney ya if you calll the api to change a value on the inventory then inital will not have any effect on that
12:55:09 sean-k-mooney inital is just used when creating an inventory and never after that
12:55:20 noonedeadpunk sean-k-mooney: ok, cool, thanks!
12:55:23 recyclehero sean-k-mooney: will u be in half an hour? I feel you are the one who save me from this misery.
12:55:26 recyclehero here
12:55:41 sean-k-mooney ill be here yes
12:55:48 recyclehero great thanks
12:56:04 noonedeadpunk recyclehero: yeah, it was exactly about that patch as I was thinking to just replace cpu_allocation_ratio with initial_cpu_allocation_ratio but it doesn't make sense for this scenario
12:57:04 sean-k-mooney recyclehero: this is the spec by the way that added inital_* https://specs.openstack.org/openstack/nova-specs/specs/stein/implemented/initial-allocation-ratios.html
12:57:26 sean-k-mooney noonedeadpunk: idealy you would support both
12:57:46 sean-k-mooney although only one of the two ways is acutlly used in any one deployment
12:58:36 Diavel Hi guys, currently working on an app which consumes rabbitmq messages from nova-compute and I am wondering - Is there a reason why there is no notification sent on `UpdateMetadata` of an instance?
12:59:16 noonedeadpunk sean-k-mooney: well, deployers are able to set overrides and define initial ones. and this patch will remove regular ones. so kind of both supported but not in very straightforward way....
12:59:16 Diavel there are for imo every other operation you can run from horizon, but there is no for metadata update
13:00:03 sean-k-mooney noonedeadpunk: ah i see well that makes sense i guess
13:00:34 sean-k-mooney noonedeadpunk: i still prefer how kolla ansible does it with config overrides rahter then provideing wrappers around things
13:01:15 noonedeadpunk sean-k-mooney: we encourage to use config overrides https://opendev.org/openstack/openstack-ansible-os_nova/src/branch/master/defaults/main.yml#L501
13:01:24 sean-k-mooney Diavel: when you ser updateMetadata what do you mean
13:01:26 noonedeadpunk but I mean we should have some defaults set?
13:01:32 sean-k-mooney Diavel: is it the server proerties
13:01:43 sean-k-mooney Diavel: or image/flaovr metadata
13:02:00 sean-k-mooney noonedeadpunk: oh you have both
13:02:09 noonedeadpunk yep :p
13:02:37 noonedeadpunk and these vars can be overriden with config_overrides so overrides have prescedence
13:02:37 sean-k-mooney ya its better in the long run i think since the user become more familar with the upstream project names and there for the release note make more sense to them
13:04:10 Diavel sean-k-mooney: it's the server metadata, not flavour
13:04:16 sean-k-mooney Diavel: are you refering to this metadata https://github.com/openstack/nova/blob/master/nova/notifications/objects/instance.py#L58
13:04:19 sean-k-mooney ah ok
13:04:39 sean-k-mooney well that is updated when you do an openstack server set --properties
13:04:46 sean-k-mooney which is not an instance action
13:05:26 sean-k-mooney it might be part of https://github.com/openstack/nova/blob/master/nova/notifications/objects/instance.py#L287
13:05:49 sean-k-mooney we dont have the filed ther ebut that might be triggered form the openstack server set
13:06:18 noonedeadpunk btw, need to remove *_allocation_ratio from config (so that value would be None) is not super convinient from our prespective:))) being able to set it as just empty string to make it not used is more neat and I guess from python prespective is not harder in implementation?
13:06:46 sean-k-mooney Diavel: wa it think its the update https://github.com/openstack/nova/blob/master/nova/notifications/objects/instance.py#L590-L598
13:07:07 noonedeadpunk as `if str()` and `if None` are both false....
13:07:28 noonedeadpunk but whatever
13:08:35 sean-k-mooney Diavel: so i think you just need to addd it to the payload and extend https://github.com/openstack/nova/blob/6a5e158756edc6c01bb23c26dcfc4c3a3df703dc/nova/notifications/base.py#L170-L207
13:08:39 noonedeadpunk ah, well, I guess it might be limitation of oslo.config... as it should be int, so can't be just empty
13:09:37 sean-k-mooney noonedeadpunk: i think you can set it to "cpu_allocation_ratio="
13:10:06 noonedeadpunk oh, really? I thought we can't....
13:10:32 Diavel sean-k-mooney: thanks a lot ;) will take a look at that part
13:10:54 sean-k-mooney noonedeadpunk: you can use 0.0 https://github.com/openstack/nova/blob/master/nova/conf/compute.py#L420-L453
13:11:41 sean-k-mooney noonedeadpunk: but i think y ou can also set it to None
13:12:23 noonedeadpunk i thought that None in config is not None, but str('None')?
13:12:30 noonedeadpunk but yeah

Earlier   Later