Moving VDisks
Sometimes you may need to free up a block store volume to replace equipment. Or a VDisk may be in active use, affecting the performance of other VDisks running on the same PDisk. In cases like this, VDisks need to be moved.
Move a VDisk from a block store volume
Get a list of VDisk IDs using YDB DSTool:
ydb-dstool -e <bs_endpoint> vdisk list --format tsv --columns VDiskId --no-header
To move a VDisk from a block store volume, run the following commands on the cluster node:
ydb-dstool -e <bs_endpoint> vdisk evict --vdisk-ids VDISK_ID1 ... VDISK_IDN
ydbd admin bs config invoke --proto 'Command { ReassignGroupDisk { GroupId: <Storage group ID> GroupGeneration: <Storage group generation> FailRealmIdx: <FailRealm> FailDomainIdx: <FailDomain> VDiskIdx: <Slot number> } }'
VDISK_ID1 ... VDISK_IDN
: The list of VDisk IDs like[GroupId:GroupGeneration:FailRealmIdx:FailDomainIdx:VDiskIdx]
. The IDs are separated by a space.GroupId
: The ID of the storage group.GroupGeneration
: Storage group generation.FailRealmIdx
: Fail realm number.FailDomainIdx
: Fail domain number.VDiskIdx
: Slot number.
Move VDisks from a broken/missing block store volume
If SelfHeal is disabled or fails to move VDisks automatically, you'll have to run this operation manually:
-
Go to monitoring and make sure that the VDisk has actually failed.
-
Get the appropriate
[NodeId:PDiskId]
using YDB DSTool:ydb-dstool -e <bs_endpoint> vdisk list | fgrep VDISK_ID
-
Move the VDisk:
ydb-dstool -e <bs_endpoint> pdisk set --status BROKEN --pdisk-ids "[NodeId:PDiskId]"
Enable the VDisk back after reassignment
To enable the VDisk back after reassignment:
-
Go to monitoring and make sure that the VDisk is actually operable.
-
Get the appropriate
[NodeId:PDiskId]
using YDB DSTool:ydb-dstool -e <bs_endpoint> pdisk list
-
Enable the PDisk back:
ydb-dstool -e <bs_endpoint> pdisk set --status ACTIVE --pdisk-ids "[NodeId:PDiskId]"