Before creating a system image Cloudmin currently tries to clean up number of settings, however leaving some of them behind, which I reported here before, for example: https://virtualmin.com/node/33249
But then I am coming to conclusion that it's not possible to report all the custom places (directories) and files. For example, users could configure their backups to store files in /backup or /backups or anywhere else in the system. In our case, we have number of Varnish related setting files, which contain some data specific to the current system like, for example, IP address associated with eth0. And when we use Cloudmin to create an image from this kind of systems all the old data are preserved and we have to clean up manually. Or we need to clean up manually the existing system first and then to create a new image from it.
But the ideal and ultimate solution for all kind of Cloudmin users would be to add a new field for indicating a path to custom clean up script on Create System Image field (/server-manager/image_form.cgi). Then Cloudmin system admins could write a small custom cleanup script, which would be triggered by Cloudmin Create System Image script.
Thanks for consideration!