openstack nova can not locate which compute of one instance located on from conductor.log

asked 2020-07-07 01:37:40 -0600

kenny2020 gravatar image

when boot one instance, after successfully scheduled but failed during vm boot on one compute node, related compute node info will be clean latter. related commit is:

Change-Id: I4d9c90b1d3fcce5237323fffcc6db1fb93d23e37 Closes-Bug: #1427944

def _nil_out_instance_obj_host_and_node(self, instance):
    # NOTE(jwcroppe): We don't do here for performance
    # reasons; a call to this is expected to be immediately followed by
    # another call that does, thus avoiding two writes
    # to the database layer. = None
    instance.node = None

for example, when network have no more ip, instance can be scheduled but can't boot up then it will be ERROR. use 'openstack server show' CMD can not find which compute node this instance scheduled, also in log we can find nothing seems.

but sometimes, especially debug VM boot error issue, it is necessary to know which compute this instance scheduled, then we can find more info about that issue.

we can add one log in nova/conductor/, for example:

def build_instances(self, context, instances, image, filter_properties,
    for (instance, host) in, hosts):
        ..."scheduled instance: %(instance)s to compute: %(hostname)s."),
                     {"instance": instance.uuid, "hostname": host_name})

is above code will affect performance? or above log necessary?

edit retag flag offensive close merge delete