)]}'
{"specs/train/approved/improve-compute-data-model.rst":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"03fee701c859030a6eaa5c3444b7b0ca27cd53e9","unresolved":false,"context_lines":[{"line_number":43,"context_line":"* disk_gb_used: The disk used in this node(in GiB)."},{"line_number":44,"context_line":"* disk_ratio: Disk allocation ratio."},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"We can calculate the free resource through the total, used and"},{"line_number":47,"context_line":"allocation ratio."},{"line_number":48,"context_line":"For example, for vcpu resource with:"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"::"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7faddb67_9b1b3f72","line":47,"range":{"start_line":46,"start_character":47,"end_line":47,"end_character":17},"updated":"2019-07-04 00:16:20.000000000","message":"Close, but I think you also have to account for reserved inventory, which is reported to placement:\n\nhttps://developer.openstack.org/api-ref/placement/?expanded\u003dlist-resource-provider-inventories-detail#list-resource-provider-inventories\n\nNova has config options for reserving host cpu/ram/disk which gets reported to placement:\n\nhttps://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.reserved_host_disk_mb\n\nhttps://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.reserved_host_cpus\n\nhttps://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.reserved_host_disk_mb (note the reserved disk is in mb but the inventory reported to placement is in GB [DISK_GB] resource class).\n\nSo to know the total capacity you have to account for (total - reserved) * allocation_ratio:\n\nhttps://github.com/openstack/placement/blob/8b33f5137a39338fdd1b28ca5e9bd165ac4e2531/placement/objects/inventory.py#L45","commit_id":"a1df58d45476a20c7da52345b415fc35c5320450"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"77ce65e6c347fec378f9052d42f06af4aed56ae3","unresolved":false,"context_lines":[{"line_number":43,"context_line":"* disk_gb_used: The disk used in this node(in GiB)."},{"line_number":44,"context_line":"* disk_ratio: Disk allocation ratio."},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"We can calculate the free resource through the total, used and"},{"line_number":47,"context_line":"allocation ratio."},{"line_number":48,"context_line":"For example, for vcpu resource with:"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"::"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7faddb67_4d5bca2d","line":47,"range":{"start_line":46,"start_character":47,"end_line":47,"end_character":17},"in_reply_to":"7faddb67_9b1b3f72","updated":"2019-07-04 02:47:52.000000000","message":"yes, reserved resource should be considered.","commit_id":"a1df58d45476a20c7da52345b415fc35c5320450"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"03fee701c859030a6eaa5c3444b7b0ca27cd53e9","unresolved":false,"context_lines":[{"line_number":56,"context_line":"The free vcpus is equal to 24."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":".. _Placement helper: http://specs.openstack.org/openstack/watcher-specs/specs/train/approved/support-placement-api.html"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"Alternatives"},{"line_number":61,"context_line":"------------"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"7faddb67_db3a17cc","line":59,"updated":"2019-07-04 00:16:20.000000000","message":"Since placement doesn\u0027t emit notifications and nova doesn\u0027t emit any notifications that include this information either, you\u0027ll have to poll placement. When do you plan on doing that? When you get notifications about compute service events from nova, or when building the data model, e.g. in here somewhere?\n\nhttps://github.com/openstack/watcher/blob/e01382cd12ecdf9bcf3537596f33bb712acbf736/watcher/decision_engine/model/collector/nova.py#L300\n\nNote that in this case, the node.id should be the hypervisor (compute node) uuid which should match the resource provider uuid for that node in placement so we should be good there.\n\nThis is mostly an implementation detail for my own information, not something you really have to call out in the spec unless others find that useful.","commit_id":"a1df58d45476a20c7da52345b415fc35c5320450"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"77ce65e6c347fec378f9052d42f06af4aed56ae3","unresolved":false,"context_lines":[{"line_number":56,"context_line":"The free vcpus is equal to 24."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":".. _Placement helper: http://specs.openstack.org/openstack/watcher-specs/specs/train/approved/support-placement-api.html"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"Alternatives"},{"line_number":61,"context_line":"------------"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"7faddb67_2d40ce07","line":59,"in_reply_to":"7faddb67_db3a17cc","updated":"2019-07-04 02:47:52.000000000","message":"There are two places that we need to get resource info from placement, one is when building the data model, as you mentioned,\nthe other is when receiving Nova notifications such as instance.create and service.create.\nhttps://github.com/openstack/watcher/blob/e01382cd12ecdf9bcf3537596f33bb712acbf736/watcher/decision_engine/model/notification/nova.py#L123","commit_id":"a1df58d45476a20c7da52345b415fc35c5320450"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"80bc9264f1a7e890c43f51a94674796bc33ed59a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"Proposed change"},{"line_number":33,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"Now Watcher had added `Placement helper`_. Watcher can get allocation"},{"line_number":36,"context_line":"ratios and reserved information from Placement."},{"line_number":37,"context_line":"We need to add some fields to the Watcher ComputeNode:"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"* vcpus_used: the number of vcpu used in this node."}],"source_content_type":"text/x-rst","patch_set":4,"id":"7faddb67_21cc5588","line":36,"range":{"start_line":35,"start_character":60,"end_line":36,"end_character":31},"updated":"2019-07-04 08:23:51.000000000","message":"and usage information as well","commit_id":"759002338d8512f008216b42dce28e86ebbcd7e5"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"10c287a7213c5469af9ca56e167eb2dc4bd77b80","unresolved":false,"context_lines":[{"line_number":32,"context_line":"Proposed change"},{"line_number":33,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"Now Watcher had added `Placement helper`_. Watcher can get allocation"},{"line_number":36,"context_line":"ratios and reserved information from Placement."},{"line_number":37,"context_line":"We need to add some fields to the Watcher ComputeNode:"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"* vcpus_used: the number of vcpu used in this node."}],"source_content_type":"text/x-rst","patch_set":4,"id":"7faddb67_94269bb7","line":36,"range":{"start_line":35,"start_character":60,"end_line":36,"end_character":31},"in_reply_to":"7faddb67_21cc5588","updated":"2019-07-05 05:44:51.000000000","message":"Done","commit_id":"759002338d8512f008216b42dce28e86ebbcd7e5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"80bc9264f1a7e890c43f51a94674796bc33ed59a","unresolved":false,"context_lines":[{"line_number":62,"context_line":"  cpu_reserved \u003d 2"},{"line_number":63,"context_line":"  cpu_ratio \u003d 5.0"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"The free vcpus is equal to 14."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":".. _Placement helper: http://specs.openstack.org/openstack/watcher-specs/specs/train/approved/support-placement-api.html"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"7faddb67_41dcf145","line":65,"updated":"2019-07-04 08:23:51.000000000","message":"math checks out :) (8 - 2) * 5 - 16 \u003d 14","commit_id":"759002338d8512f008216b42dce28e86ebbcd7e5"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"10c287a7213c5469af9ca56e167eb2dc4bd77b80","unresolved":false,"context_lines":[{"line_number":62,"context_line":"  cpu_reserved \u003d 2"},{"line_number":63,"context_line":"  cpu_ratio \u003d 5.0"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"The free vcpus is equal to 14."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":".. _Placement helper: http://specs.openstack.org/openstack/watcher-specs/specs/train/approved/support-placement-api.html"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"7faddb67_74219f9f","line":65,"in_reply_to":"7faddb67_41dcf145","updated":"2019-07-05 05:44:51.000000000","message":"Done","commit_id":"759002338d8512f008216b42dce28e86ebbcd7e5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"387d52b5d3d9e3840ecdcaa4b82e56b4cd142bdd","unresolved":false,"context_lines":[{"line_number":53,"context_line":"* disk_gb_reserved: The amount of disk a node has reserved for its own use."},{"line_number":54,"context_line":"* disk_ratio: Disk allocation ratio."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"We can calculate the free resource through the total, reseverd, used and"},{"line_number":57,"context_line":"allocation ratio."},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"The formula:"}],"source_content_type":"text/x-rst","patch_set":6,"id":"7faddb67_91fd103c","line":56,"range":{"start_line":56,"start_character":54,"end_line":56,"end_character":62},"updated":"2019-07-10 01:13:50.000000000","message":"reserved","commit_id":"b511d16b1a14a7653a043b37722436d51bcd66d0"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"ea2e2c3a376aef4dd39e7bba87b4fc3fcd653292","unresolved":false,"context_lines":[{"line_number":53,"context_line":"* disk_gb_reserved: The amount of disk a node has reserved for its own use."},{"line_number":54,"context_line":"* disk_ratio: Disk allocation ratio."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"We can calculate the free resource through the total, reseverd, used and"},{"line_number":57,"context_line":"allocation ratio."},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"The formula:"}],"source_content_type":"text/x-rst","patch_set":6,"id":"7faddb67_7c286885","line":56,"range":{"start_line":56,"start_character":54,"end_line":56,"end_character":62},"in_reply_to":"7faddb67_91fd103c","updated":"2019-07-10 06:30:10.000000000","message":"Done","commit_id":"b511d16b1a14a7653a043b37722436d51bcd66d0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"387d52b5d3d9e3840ecdcaa4b82e56b4cd142bdd","unresolved":false,"context_lines":[{"line_number":71,"context_line":"The free vcpus is (8 - 2) * 5 - 16 \u003d 14."},{"line_number":72,"context_line":""},{"line_number":73,"context_line":".. _Placement helper: http://specs.openstack.org/openstack/watcher-specs/specs/train/approved/support-placement-api.html"},{"line_number":74,"context_line":".. _list resource provider inventories: https://developer.openstack.org/api-ref/placement/?expanded\u003dlist-allocations-detail,show-resource-provider-inventory-detail#list-resource-provider-inventories"},{"line_number":75,"context_line":".. _list resource provider usages: https://developer.openstack.org/api-ref/placement/?expanded\u003dlist-allocations-detail,list-resource-provider-usages-detail#list-resource-provider-usages"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"Compute Data Model"}],"source_content_type":"text/x-rst","patch_set":6,"id":"7faddb67_f1fec436","line":74,"range":{"start_line":74,"start_character":100,"end_line":74,"end_character":123},"updated":"2019-07-10 01:13:50.000000000","message":"nit: I\u0027m guessing you didn\u0027t intend for this to be in the link (and below).","commit_id":"b511d16b1a14a7653a043b37722436d51bcd66d0"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"ea2e2c3a376aef4dd39e7bba87b4fc3fcd653292","unresolved":false,"context_lines":[{"line_number":71,"context_line":"The free vcpus is (8 - 2) * 5 - 16 \u003d 14."},{"line_number":72,"context_line":""},{"line_number":73,"context_line":".. _Placement helper: http://specs.openstack.org/openstack/watcher-specs/specs/train/approved/support-placement-api.html"},{"line_number":74,"context_line":".. _list resource provider inventories: https://developer.openstack.org/api-ref/placement/?expanded\u003dlist-allocations-detail,show-resource-provider-inventory-detail#list-resource-provider-inventories"},{"line_number":75,"context_line":".. _list resource provider usages: https://developer.openstack.org/api-ref/placement/?expanded\u003dlist-allocations-detail,list-resource-provider-usages-detail#list-resource-provider-usages"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"Compute Data Model"}],"source_content_type":"text/x-rst","patch_set":6,"id":"7faddb67_3ca51005","line":74,"range":{"start_line":74,"start_character":100,"end_line":74,"end_character":123},"in_reply_to":"7faddb67_f1fec436","updated":"2019-07-10 06:30:10.000000000","message":"Done","commit_id":"b511d16b1a14a7653a043b37722436d51bcd66d0"}]}
