Revision 7b5f0674

b/NEWS
21 21
  checks whether there are instances still using those templates.
22 22
- 'gnt-node list-storage' now also reports storage information about
23 23
  file-based storage types.
24
- In case of non drbd instances, export \*_SECONDARY environment variables
25
  as empty strings (and not "None") during 'instance-migrate' related hooks.
24 26

  
25 27
New features
26 28
~~~~~~~~~~~~
b/doc/hooks.rst
379 379

  
380 380
:directory: instance-failover
381 381
:env. vars: IGNORE_CONSISTENCY, SHUTDOWN_TIMEOUT, OLD_PRIMARY, OLD_SECONDARY, NEW_PRIMARY, NEW_SECONDARY
382
:pre-execution: master node, secondary node
383
:post-execution: master node, primary and secondary nodes
382
:pre-execution: master node, secondary (target) node
383
:post-execution: master node, primary (source) and secondary (target) nodes
384 384

  
385 385
OP_INSTANCE_MIGRATE
386 386
++++++++++++++++++++
......
391 391

  
392 392
:directory: instance-migrate
393 393
:env. vars: MIGRATE_LIVE, MIGRATE_CLEANUP, OLD_PRIMARY, OLD_SECONDARY, NEW_PRIMARY, NEW_SECONDARY
394
:pre-execution: master node, primary and secondary nodes
395
:post-execution: master node, primary and secondary nodes
394
:pre-execution: master node, primary (source) and secondary (target) nodes
395
:post-execution: master node, primary (source) and secondary (target) nodes
396 396

  
397 397

  
398 398
OP_INSTANCE_REMOVE
b/lib/cmdlib/instance_migration.py
136 136
    """
137 137
    instance = self._migrater.instance
138 138
    source_node_uuid = instance.primary_node
139
    target_node_uuid = self._migrater.target_node_uuid
139 140
    env = {
140 141
      "IGNORE_CONSISTENCY": self.op.ignore_consistency,
141 142
      "SHUTDOWN_TIMEOUT": self.op.shutdown_timeout,
142 143
      "OLD_PRIMARY": self.cfg.GetNodeName(source_node_uuid),
143
      "NEW_PRIMARY": self.op.target_node,
144
      "NEW_PRIMARY": self.cfg.GetNodeName(target_node_uuid),
144 145
      "FAILOVER_CLEANUP": self.op.cleanup,
145 146
      }
146 147

  
......
160 161
    """
161 162
    instance = self._migrater.instance
162 163
    nl = [self.cfg.GetMasterNode()] + list(instance.secondary_nodes)
164
    nl.append(self._migrater.target_node_uuid)
163 165
    return (nl, nl + [instance.primary_node])
164 166

  
165 167

  
......
198 200
    """
199 201
    instance = self._migrater.instance
200 202
    source_node_uuid = instance.primary_node
203
    target_node_uuid = self._migrater.target_node_uuid
201 204
    env = BuildInstanceHookEnvByObject(self, instance)
202 205
    env.update({
203 206
      "MIGRATE_LIVE": self._migrater.live,
204 207
      "MIGRATE_CLEANUP": self.op.cleanup,
205 208
      "OLD_PRIMARY": self.cfg.GetNodeName(source_node_uuid),
206
      "NEW_PRIMARY": self.op.target_node,
209
      "NEW_PRIMARY": self.cfg.GetNodeName(target_node_uuid),
207 210
      "ALLOW_RUNTIME_CHANGES": self.op.allow_runtime_changes,
208 211
      })
209 212

  
......
211 214
      env["OLD_SECONDARY"] = self.cfg.GetNodeName(instance.secondary_nodes[0])
212 215
      env["NEW_SECONDARY"] = self.cfg.GetNodeName(source_node_uuid)
213 216
    else:
214
      env["OLD_SECONDARY"] = env["NEW_SECONDARY"] = None
217
      env["OLD_SECONDARY"] = env["NEW_SECONDARY"] = ""
215 218

  
216 219
    return env
217 220

  
......
222 225
    instance = self._migrater.instance
223 226
    snode_uuids = list(instance.secondary_nodes)
224 227
    nl = [self.cfg.GetMasterNode(), instance.primary_node] + snode_uuids
228
    nl.append(self._migrater.target_node_uuid)
225 229
    return (nl, nl)
226 230

  
227 231

  
......
350 354
        raise errors.ConfigurationError("No secondary node but using"
351 355
                                        " %s disk template" %
352 356
                                        self.instance.disk_template)
353
      target_node_uuid = secondary_node_uuids[0]
357
      self.target_node_uuid = target_node_uuid = secondary_node_uuids[0]
354 358
      if self.lu.op.iallocator or \
355 359
        (self.lu.op.target_node_uuid and
356 360
         self.lu.op.target_node_uuid != target_node_uuid):

Also available in: Unified diff