Activity log for bug #1297667

Date Who What changed Old value New value Message
2014-03-26 07:37:37 Yi Liu bug added bug
2014-03-26 07:38:32 Yi Liu description We can assign multi value for one key when using nova boot, for example, below we indicate 2 different_host hints: nova boot --image cedef40a-ed67-4d10-800e-17455edce175 --flavor 1 --hint different_host=a0cf03a5-d921-4877-bb5c-86d26cf818e1 --hint different_host=8c19174f-4220-44f0-824a-cd1eeef10287 server-1 However, in Heat, for example when we compose the instance in template like below: "server-2": { "Type": "AWS::EC2::Instance", "Properties": { "ImageId": { "Ref" : "image" }, "InstanceType": { "Ref" : "flavor" }, "NovaSchedulerHints": [{"Key":"different_host", "Value": {"Ref": "instance_1_id"}}, {"Key":"different_host", "Value": {"Ref": "instance_2_id"}}] }, "UserData": { "Fn::Base64": "userdata content, not used in this case" } } Only the different_host=<instance_2_id> is effective. I have check the </usr/lib/python2.6/site-packages/heat/engine/resources/instance.py>, from line 327 to 332: 327 scheduler_hints = {} 328 if self.properties['NovaSchedulerHints']: 329 for tm in self.properties['NovaSchedulerHints']: 330 scheduler_hints[tm['Key']] = tm['Value'] 331 else: 332 scheduler_hints = None According to my understanding, in the example case, the later different_host overwrote the previous one. That's why only the different_host=<instance_2_id> is effective. As a result, I think this might be a bug/shortage. Or maybe the format of the example template above is wrong, then please guide how to compose the NovaSchedulerHints for multi value for one key in correct way. Any way, need you guys confirmation. Thank you! We can assign multi value for one key when using nova boot, for example, below we indicate 2 different_host hints: nova boot --image cedef40a-ed67-4d10-800e-17455edce175 --flavor 1 --hint different_host=a0cf03a5-d921-4877-bb5c-86d26cf818e1 --hint different_host=8c19174f-4220-44f0-824a-cd1eeef10287 server-1 However, in Heat, for example when we compose the instance in template like below: "server-2": {       "Type": "AWS::EC2::Instance",       "Properties": {         "ImageId": { "Ref" : "image" },         "InstanceType": { "Ref" : "flavor" },         "NovaSchedulerHints": [{"Key":"different_host", "Value": {"Ref": "instance_1_id"}},{"Key":"different_host", "Value": {"Ref": "instance_2_id"}}]},       "UserData": { "Fn::Base64": "userdata content, not used in this case" }     } Only the different_host=<instance_2_id> is effective. I have check the </usr/lib/python2.6/site-packages/heat/engine/resources/instance.py>, from line 327 to 332: 327 scheduler_hints = {} 328 if self.properties['NovaSchedulerHints']: 329 for tm in self.properties['NovaSchedulerHints']: 330 scheduler_hints[tm['Key']] = tm['Value'] 331 else: 332 scheduler_hints = None According to my understanding, in the example case, the later different_host overwrote the previous one. That's why only the different_host=<instance_2_id> is effective. As a result, I think this might be a bug/shortage. Or maybe the format of the example template above is wrong, then please guide how to compose the NovaSchedulerHints for multi value for one key in correct way. Any way, need you guys confirmation. Thank you!
2014-03-31 20:27:43 Steven Hardy heat: status New Triaged
2014-03-31 20:27:48 Steven Hardy heat: importance Undecided Medium
2014-03-31 20:27:52 Steven Hardy heat: milestone juno-1
2014-04-03 16:07:21 Pavlo Shchelokovskyy heat: assignee Pavlo Shchelokovskyy (pshchelo)
2014-04-03 16:08:00 OpenStack Infra heat: status Triaged In Progress
2014-04-14 05:36:43 OpenStack Infra heat: status In Progress Fix Committed
2014-05-27 21:27:09 Steve Baker tags heat novaschedulerhints heat icehouse-backport-potential novaschedulerhints
2014-06-11 18:44:58 Thierry Carrez heat: status Fix Committed Fix Released
2014-10-16 09:44:48 Thierry Carrez heat: milestone juno-1 2014.2