If, like me, you have been through all the versions of View Composer and the broker since its introduction, various bugs and broken recompositions will have left you with a large amount of detritus in your VMwareViewComposerReplicaFolder, making it hard to keep an eye on the proper operation of the Composer, and in my case, causing a datastore to run out of space and subsequent operations to fail. Time for a clean up.
This is decently documented here, but how do you know which ones you can delete?
I don’t and have never worked in the Composer team, so corrections and additions welcome on the below especially where I have marked (???), but observation of the tasks shows the process is as follows:
- Copy parent VM at certain snapshot to a new VM called temp-<ridiculousGUID> in the same place as the parent VM
- Delete that VM (??? Clearly something else is happening, but you watch the tasks)
- Copy that VM to each datastore and register as replica-<ridiculousGUID> (???)
- Create a linked clone off each replica in the same datastore, and register as source-<ridiculousGUID>
- For each VM, copy the source VM to a new directory and link it back to the replica
All well and good until this process breaks down and you’re left with the broken bodies of hapless VMs lying around. So you should have one source and one replica VM for each parent snapshot deployed in each datastore. The formula is
VMs in replica folder = <Num. parent snapshots in active use> x <Num. datastores> x 2
In my environment I have one parent VM snapshot in use by 40 VMs spread across 4 datastores. So:
1 snapshot x 4 datastores x 2 = 8 VMs in replica folder
So I should have 8 in there. What do I actually have?
Err, 10. Those two temp- VMs ought to have been deleted by the composer. This is the view after I’d done aload of cleaning up – I originally had all sorts of dead source and replica VMs in there. How do I know which ones are actively in use and which can be deleted? A simple tip is to change the value of the Notes property of the parent VM, and redeploy your clones. Anything the Composer is still properly in charge of and not using will be deleted automatically. Anything else will be very visible. Look at that image again, and you’ll see that the two temp VMs have different date values in the Notes column. They are from a previous snapshot, and can be deleted. Follow the process in the link above to unprotect them, and then right-click and Delete from disk.
I have now deleted about 15 different source, replica and temp VMs in this way, and all operation is still normal.