Cannot create clone image

gemugemu Posts: 14 New member
Hi,

I'm trying to create a clone from backup. The user for the agent is local admin, has rights on the share for the images and is added as sysadmin in the database server.

The error I get is the following:

2019-01-30 16:59:10.814 +01:00 [Information] SQL Clone Agent version: 3.0.9.15307, machine name: SomeServer, user: SomeUser, OS: Microsoft Windows NT 6.2.9200.0
2019-01-30 16:59:10.814 +01:00 [Information] CreateImageRequestEvent (image name: "ADatabaseName") 10087 (Operation) started
2019-01-30 16:59:10.970 +01:00 [Information] Directory not found when deleting F:\Redgateimage\ADatabaseName_00000011_ygl, assuming it was already deleted
2019-01-30 16:59:11.001 +01:00 [Error] CreateImageRequestEvent (image name: "ADatabaseName") 10087 (Operation) failed with general exception
System.Management.ManagementException: Generic failure
   at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
   at System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject inParameters, InvokeMethodOptions options)
   at RedGate.SqlClone.Core.StorageApi.WmiInstance.InvokeMethod(String methodName, IEnumerable`1 inParameters)
   at RedGate.SqlClone.Core.StorageApi.DiskImage.Mount(DiskAccess access, Boolean noDriveLetter)
   at RedGate.SqlClone.Core.VirtualDisk.WmiDiskImageService.GetDiskImageAndMountAsReadWrite(String diskImagePath, IWmiStorageSession session)
   at RedGate.SqlClone.Core.VirtualDisk.WmiDiskImageService.<>c__DisplayClass11_0.<CreateDiskImageAndMount>b__0(IWmiStorageSession session)
   at RedGate.SqlClone.Core.VirtualDisk.WmiDiskImageService.RunInsideSession(CancellationToken ct, Action`1 runAction)
   at RedGate.SqlClone.Core.VirtualDisk.WmiDiskImageService.CreateDiskImageAndMount(String diskImagePath, UInt64 requiredSpaceInBytes, UInt64 requestedVirtualSize, String mountPath, CancellationToken ct)
   at RedGate.SqlClone.Core.Vhd.VhdImage.<>c__DisplayClass5_0.<<TakeImage>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.SqlClone.Agent.Drivers.Vhd.VhdImageCreationDriver.<CreateImage>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.SqlClone.Agent.Drivers.ImageDriver.<CreateImage>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.SqlClone.Agent.AgentImageService.<CreateImage>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at RedGate.SqlClone.Agent.AgentImageService.<CreateImage>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.SqlClone.Agent.OperationContext.OperationLifetimeManager.<Run>d__5.MoveNext()


Can someone maybe shed some light on whats happening here? I also find it strange that in the delete error it mentions F:\Redgateimage while i've not used that in my parameters. I've provided the UNC path to a share, this is the local path to that share. Not sure if that is normal or maybe an indication of my issue.

Also, what are the underlying privileges that are expected from the local administrator role so I can check permission on a lower level?

Its always mentioned that the agent users needs local admin and access to the share but what about the user which is running the SQL Server service? Does he also require permissions on the share or certain privileges?

Regards

Answers

  • Hello @gemu.

    The permissions that you've set are fine. Here you can find more about the requirements.

    Regarding the concerns that you have with the UNC path, we are converting the UNC paths to local paths, so it's not an issue.

    The user account that runs the SQL Server service, doesn't need to have privileges on the shared location.

    There are two possible issues:
    1. There isn't sufficient disk space on the shared location.
    2. There is an issue when Windows tries to create or attach a Virtual Hard Disk (VHD) image.

    To test the last case, you can open the Disk Management (diskmgmt.msc) and try to create a VHD image by going to Action ---> Create VHD. The size of the VHD image should be roughly the same as the size of the database that you are trying to create an image from and the VHD type should be Dynamically expanding.
    After that you can try to attach the exported image by going to Action ---> Attach VHD.

    If any error occurs in the above process, then something goes wrong with the operating system.

    Kind regards,
    Panagis
  • MielMiel Posts: 1 New member
    Same issue here, where the above solution (2 posiblities) do not apply/work for me. issue started for just one of five servers when updating to version 3.1.0. 

    Any help would be much appriciated. 


  • gemugemu Posts: 14 New member
    Hi,

    The root cause we identified was a missing privilege: ‘perform volume maintenance tasks’

    We have a group policy set up to allow a specific group of users to perform volume maintenance tasks and the agent user is not part of the group.This GPO overwrites the default setting and removes the local administrators group from the ‘perform volume maintenance tasks’ local security setting.

  • gemugemu Posts: 14 New member
    Hi,

    Thanks for commenting on the UNC path, this is in line with my assumption then.

    Now on the problem, that there was an issue with creating or attaching the VHD was already the assumption based on the stacktrace. As its not documented here which privileges are actually required from the local administrator role we hoped to get some more info on this.

    The root cause we eventually identified was a missing privilege: ‘perform volume maintenance tasks’

    We have a GPO set up to allow a specific group of users to perform volume maintenance tasks and the agent user is not part of the group.This GPO overwrites the default setting and removes the local administrators group from the ‘perform volume maintenance tasks’ local security setting.


    Regards

  • gemugemu Posts: 14 New member
    Hi,

    Thanks for commenting on the UNC path, this is in line with my assumption then.

    Now on the problem, that there was an issue with creating or attaching the VHD was already the assumption based on the stacktrace. As its not documented here which privileges are actually required from the local administrator role we hoped to get some more info on this.

    The root cause we eventually identified was a missing privilege: ‘perform volume maintenance tasks’

    We have a GPO set up to allow a specific group of users to perform volume maintenance tasks and the agent user is not part of the group.This GPO overwrites the default setting and removes the local administrators group from the ‘perform volume maintenance tasks’ local security setting.


    Regards

Sign In or Register to comment.