Error mounting CloudDrive snapshot in Azure

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2010-07-06T05:05:25Z Indexed on 2011/01/17 23:53 UTC
Read the original article Hit count: 436

Hi,

I've been running a cloud drive snapshot in dev for a while now with no probs. I'm now trying to get this working in Azure.

I can't for the life of me get it to work. This is my latest error:

Microsoft.WindowsAzure.Storage.CloudDriveException: Unknown Error HRESULT=D000000D --->

Microsoft.Window.CloudDrive.Interop.InteropCloudDriveException: Exception of type 'Microsoft.WindowsAzure.CloudDrive.Interop.InteropCloudDriveException' was thrown.

   at ThrowIfFailed(UInt32 hr)

   at Microsoft.WindowsAzure.CloudDrive.Interop.InteropCloudDrive.Mount(String url, SignatureCallBack sign, String mount, Int32 cacheSize, UInt32 flags)

   at Microsoft.WindowsAzure.StorageClient.CloudDrive.Mount(Int32 cacheSize, DriveMountOptions options)

Any idea what is causing this? I'm running both the WorkerRole and Storage in Azure so it's nothing to do with the dev simulation environment disconnect.

This is my code to mount the snapshot:

        CloudDrive.InitializeCache(localPath.TrimEnd('\\'), size);

        var container = _blobStorage.GetContainerReference(containerName);
        var blob = container.GetPageBlobReference(driveName);

        CloudDrive cloudDrive = _cloudStorageAccount.CreateCloudDrive(blob.Uri.AbsoluteUri);
        string snapshotUri;
        try
        {
            snapshotUri = cloudDrive.Snapshot().AbsoluteUri;

            Log.Info("CloudDrive Snapshot = '{0}'", snapshotUri);
        }
        catch (Exception ex)
        {
            throw new InvalidCloudDriveException(string.Format(
                    "An exception has been thrown trying to create the CloudDrive '{0}'. This may be because it doesn't exist.",
                    cloudDrive.Uri.AbsoluteUri), ex);
        }

        cloudDrive = _cloudStorageAccount.CreateCloudDrive(snapshotUri);

        Log.Info("CloudDrive created: {0}", snapshotUri, cloudDrive);

        string driveLetter = cloudDrive.Mount(size, DriveMountOptions.None);

The .Mount() method at the end is what's now failing.

Please help as this has me royally stumped!

Thanks in advance.

Dave

© Stack Overflow or respective owner

Related posts about Azure

Related posts about blobstorage