Microsoft Virtualization Discussions

new-clone cmdlet

aschneider146
5,358 Views

I am trying to clone a VM in a CSV. I do not have SCVMM installed in this enviornoment. I installed OnCommand on a cluster node and the CSV that the VM is on is owned by the same node.

When i run new-clone, I get an error that says

New-Clone : Operation failed. Exiting progress message processing. Status VMCloneEngine::Clone: ValidateVHDDiskPaths failed reason Validate VHD path found that following VHD paths are not on NetApp LUN

C:\ClusterStorage\Volume3\base\SubLunBase\Virtual Hard Disks\BigBase.vhd

This VHD is definitely on a NetApp LUN.

Thanks,

Andy

10 REPLIES 10

jausch
5,339 Views

Correct.  New-Clone -template requires SCVMM.

If you want to just clone a file, use CLONE-FILE.

Like this:

clone-file C:\ClusterStorage\Volume1\VMs\W2kr2SysPrep.vhd C:\ClusterStorage\Volume1\VMs\PSCLone.vhd

Note that you must specify the full path to the source and the target in this build of the cmdlet.

Alex

aschneider146
5,339 Views

That makes sense. However, when I run clone-file, I am getting an error that says

Clone-File : Operation failed. Exiting progress message processing. Status Coul

d not connect to net.tcp://localhost/VIM/VIMSubscriptionService/v_10. The conne

ction attempt lasted for a time span of 00:00:00. TCP error code 10061: No conn

ection could be made because the target machine actively refused it 127.0.0.1:8

08.

aschneider146
5,339 Views

never mind.. just realized the service was stopped... i think my GPO is shutting it down.

davidv
5,339 Views

new-clone -template requires SCVMM

new-clone -vmname does not require SCVMM.  OCPM has its onw cloning engine.

Andy, can you post the cmdlet you ran?

aschneider146
5,339 Views

A couple things. i was able to get clone-file to work. I just had to add a storage credential.

Now I cannot repeat the initial error I was seeing with new-clone, but I am consistently getting another problem.

PS C:\> new-clone  -VMName SubLunBase -BaseVMName newVM -AllInSourceLUN -nc 1
New-Clone : Operation failed. Exiting progress message processing. Status Clone
of vhd file failed
At line:1 char:10
+ new-clone <<<<   -VMName SubLunBase -BaseVMName newVM -AllInSourceLUN -nc 1
    + CategoryInfo          : InvalidArgument: (NetApp.SystemCenter.ScCloneCmd
   let:ScCloneCmdlet) [New-Clone], Exception
    + FullyQualifiedErrorId : NetApp.SystemCenter.ScCloneCmdlet

SubLunBase is the name of the VM that I am trying to clone into the same LUN.

jausch
5,339 Views

Can you post your clone log please?  Should be here:

C:\Program Files\NetApp\OnCommand\MS_Plugin\OC.VIM.WebService

Alex

aschneider146
5,339 Views

So the error that was occurring before was that the destination file already existed. Seems like when it failed, it didn't clean up the file. I manually deleted the destination vhd file and now am getting an error that says Object reference not set to an instance of an object.

/08/2011 02:45:26:837 :  ProcessID= 2808 ThreadID= 3 OperationProgressEvent called
06/08/2011 02:45:26:837 :  ProcessID= 2808 ThreadID= 3 OperationProgressEvent done
06/08/2011 02:45:26:837 :  ProcessID= 2808 ThreadID= 3 the VIMPublishService client state = Opened
06/08/2011 02:45:26:837 :  ProcessID= 2808 ThreadID= 3 An error occured while executing the VMCloneEngine::Clone.
Object reference not set to an instance of an object.Source: OC.VSMServices
Stack Trace:    at NetApp.SCI.Common.VSMServices.VirtualSystemManagementService.CloneVirtualSystemConfigOnlyEx(String vmName, String exportDirectory, Boolean isDirectory, String newVMName, Int32 count, String DestinationHost, String SourceHost)
   at NetApp.SCI.Common.VSMServices.VirtualSystemManagementService.CloneVirtualSystemConfigOnly(String vmName, String exportDirectory, Boolean isDirectory, String newVMName, Int32 count, String DestinationHost, String SourceHost)
   at NetApp.SystemCenter.VMCloneEngine.Clone(ScCreateCloneRequest request)

06/08/2011 02:45:26:852 :  ProcessID= 2808 ThreadID= 3 An error occured while executing the VMCloneEngine::Clone.
Object reference not set to an instance of an object.
06/08/2011 02:45:26:852 :  ProcessID= 2808 ThreadID= 3 VMCloneEngine::Clone-Exit
06/08/2011 02:45:26:852 :  ProcessID= 2808 ThreadID= 3 VMCloneCommand::Execute-Exit
06/08/2011 02:45:26:852 :  ProcessID= 2808 ThreadID= 3 An error occured while executing the VMCloneEngine::Clone.

I'll attach the entire log file as well

shankarn
5,339 Views

Hi Andy,

We can see this "Object reference not set to an instance of an object" error when we try to clone a VM which is owned by any another

node in the cluster and not the node from where the cmdlet is running

I can see that you have already mentioned that the CSV storage is owned by the same node from where the cmdlet is running which

is fine, along with this we should also make sure that the VM which resides in that CSV storage is also owned by the same node

from where you are running the cmdlet

Shankar

aschneider146
4,299 Views

The VM and CSV are both owned by the node that I am running new-clone on. It is successfully cloning the right VHD but fails on the WMI call into Hyper-V. Also, the VM that I am trying to clone is in c:\clusterstorage\volume3\base and has a "virtual hard disks" and "virtual machines" sub directory.

The name of the new VM is subluntest1. It cloned the VHD into c:\clusterstorage\volume3\bigbase.vhd. I would expect it to clone the VM into a new directory c:\clusterstorage\volume3\subluntest1\virtual hard disks\bigbase.vhd. Does this get cleaned up later on if the cmdlet succeeds?

Lastly, if the cmdlet does clone the vhd but fails as is the case here, it should delete the VHD.

ankushb
5,339 Views

We would appreciate if cmdlets can be executed with -verbose switch, that will help the team to troubleshoot

For example new-clone  -VMName SubLunBase -BaseVMName newVM -AllInSourceLUN -nc 1  -verbose

Public