vmname impletemented to provide a vm name or to modify the vm name with prefix or idx parameters. it was originally implemented by Mark from cm_label.py