Porting scripting improvements from centos_vm