I'm not sure I get the meaning of that script; you take a VM and clone it, expcept for Hard disk 1.
That means your cloned VM (targetVM) is a copy of the original VM except for the OS disk.
Is that correct ?
And if yes, why do you do it that like this ? That targetVM can not run as far as I understand it.