def _ConvertDrbdToPlain(self, feedback_fn):
    secondary_nodes = self.cfg.GetInstanceSecondaryNodes(self.instance.uuid)
    disks = self.cfg.GetInstanceDisks(self.instance.uuid)
    assert len(secondary_nodes) == 1
    assert utils.AnyDiskOfType(disks, [constants.DT_DRBD8])

    feedback_fn("Converting disk template from 'drbd' to 'plain'")

    old_disks = AnnotateDiskParams(self.instance, disks, self.cfg)
    new_disks = [d.children[0] for d in disks]

    # copy over size, mode and name and set the correct nodes
    for parent, child in zip(old_disks, new_disks):
      child.size = parent.size
      child.mode = parent.mode
      child.name = parent.name
      child.nodes = [self.instance.primary_node]

    # this is a DRBD disk, return its port to the pool
    for disk in old_disks:
      tcp_port = disk.logical_id[2]
      self.cfg.AddTcpUdpPort(tcp_port)

    # Remove the old disks from the instance
    for old_disk in old_disks:
      self.cfg.RemoveInstanceDisk(self.instance.uuid, old_disk.uuid)

    # Attach the new disks to the instance
    for (idx, new_disk) in enumerate(new_disks):
      self.cfg.AddInstanceDisk(self.instance.uuid, new_disk, idx=idx)

    # re-read the instance from the configuration
    self.instance = self.cfg.GetInstanceInfo(self.instance.uuid)

    # Release locks in case removing disks takes a while
    ReleaseLocks(self, locking.LEVEL_NODE)

    feedback_fn("Removing volumes on the secondary node...")
    RemoveDisks(self, self.instance, disks=old_disks,
                target_node_uuid=secondary_nodes[0])

    feedback_fn("Removing unneeded volumes on the primary node...")
    meta_disks = []
    for idx, disk in enumerate(old_disks):
      meta_disks.append(disk.children[1])
    RemoveDisks(self, self.instance, disks=meta_disks)
Hook method for deconstructing the test fixture after testing it.
dataset/ETHPy150Open ganeti/ganeti/lib/cmdlib/instance_set_params.py/LUInstanceSetParams._ConvertDrbdToPlain--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.3/django/utils/unittest/case.py/TestCase.tearDown