cannot remove a node that has vtemplate
A node can not be removed if there's vtemplate on it or owned by it let's say. Is there any workaround to remove this node?
Related issue might be #2035 .
Hi @yongshengma vTemplates are read-only volumes. To read from them, they'd have to be running somewhere. The GUI currently doesn't support moving vTemplates across different nodes. The API and the controllers do. (API: /vdisks/GUID/move, data being {'target_storagerouter_guid': GUID}). Controller: VDiskController.move) Here is a small script to move all vtemplates to a different storagerouter
import random
from ovs.dal.lists.vdisklist import VDiskList
from ovs.lib.vdisk import VDiskController
vtemplates = [vd for vd in VDiskList.get_vdisks() if vd.is_vtemplate]
for vtemplate in vtemplates:
vpool = vtemplate.vpool
try:
destination_std = random.choice([storagedriver for storagedriver in vpool.storagedrivers if storagedriver.storagedriver_id != vtemplate.storagedriver_id])
except IndexError:
print 'No destinations available'
continue
print 'Moving {0} to {1}'.format(vtemplate.name, destination_std.storagerouter.name)
VDiskController.move(vdisk_guid=vtemplate.guid, target_storagerouter_guid=destination_std.storagerouter.guid, force=False)
I'll keep this ticket open: The vtemplate section in the GUI should allow the disk to get moved to a different host.
Nice! Thanks!