too many VDI/VHD per VM, how to get rid of unused ones
-
hi all,
i seem to have a LOT of unused VDI's for my VM's, im guessing its because i have made multiple copies of my VM's but its still kept the hard drive
how do i delete the unsused VDI's
im following this guide
http://deepix.github.io/2017/02/01/xsvdi.html
and when im running theses commands
[root@lon-p-xenserver01 ~]# xe vdi-list sr-uuid=0f956522-42d7-5328-a5ec-a7fd406ca0f3 params=uuid managed=true > /vdi_sr_list.txt
[root@lon-p-xenserver01 ~]# xe vbd-list vdi-uuid=cc47329b-f342-4c37-ab8f-e37df65845e4 params=vm-name-label
[root@lon-p-xenserver01 ~]# xe vbd-list vdi-uuid=d7d14ba2-eb82-4c5f-ac25-c352bf91cc7a params=vm-name-label
vm-name-label ( RO) : Control domain on host: lon-p-xenserver01[root@lon-p-xenserver01 ~]#
now obviously
cc47329b-f342-4c37-ab8f-e37df65845e4
is ok to delete as the vdi is not with a vbd
but what about d7d14ba2-eb82-4c5f-ac25-c352bf91cc7a ??
thanks,
rob
-
This would have been far easier if you used Xen Orchestra to see all those orphaned VDIs
-
@olivierlambert how do i do that, can i delete the orpahned vdi's from there aswell?
-
Yes, you can.
- In SR view in XO, you have a filter "Orphaned VDI" you can select them all and remove them all at once
- In Dashboard/Health view, you have a recap on all potential VDI issues. You can also delete all VDIs needed there
-
Olivier, you are awesome as i was going to do all this manually!!!!!!!!!!!!!!!!!
so is it ok to delete all the "Orphaned snapshot VDIs" and "Orphaned VMs snapshot"
-
Yes, I would do that. It means all those VDIs aren't connected to any VM. So it's very likely (except if you did something on purpose) that those VDIs are useless.
I think you get why Xen Orchestra is the de facto client for Citrix Hypervisor and XCP-ng
-
@olivierlambert yes i can see now why XOA works really well with xen/xcp-ng
-
mmm.... its asking me for the orphaned vm snapshots if i really want to delete them
im guessing i do?!?
-
There's no reason to have orphaned VM snapshots
-
thanks Olivier!!!!!!
now my VDI's, i see i have multiple VDI's for my VMs
for example my "dataio vm"
i have a main vm running and i have a continious replication of the dataio vm
now can i delete any of them as i seem to be just racking up multiple VDI's of the same VM
-
Continue to remove all orphaned VDIs
-
@olivierlambert but I can't see any more orphaned vdis on XOA?
-
In the SR view, disk tab, bottom right, magnifying glass icon, select "Orphaned VDIs".
-
@olivierlambert your amazing Olivier, so I imagine I can delete all the orphaned vdi's
-
Yes, as long as you don't have intentionally left a VDI connected to no VM whatsoever, you can remove all of them.
-
im looking and i see no vms attached to the orphaned disks
-
That's by definition why are they called "orphaned" The question is: have you decided to disconnect some VDI of some VM by yourself or they just are here because they are leftover of some failed operations?
I think that in your case, you can remove them all.
-
thanks Olivier because when i change the magnifying glass to "type:!VDI-unmanaged" i see under the VMs the actual live vm name and the backup vm so i think its safe to delete all the orphaned ones
-
Yes, VDIs connected to a VM are by definition not orphaned. You don't want to remove those.
-
just out of interest when i change the magnifying glass to "type:VDI-unmanaged"
it lists "base copy"
what are they?