예제 #1
0
        /// <summary>
        /// remove the vmbackups with the metadata  key "vmbackuptag" and value snapshotTag, snapshotTag is the parameter passed in.
        /// </summary>
        /// <param name="resourceGroupName"></param>
        /// <param name="vmName"></param>
        /// <param name="virtualMachineExtensionType"></param>
        /// <param name="location"></param>
        /// <param name="virtualMachineResponse"></param>
        /// <param name="profile"></param>
        /// <param name="VirtualMachineExtensionClient"></param>
        /// <param name="snapshotTag"></param>
        public void RemoveSnapshot(AzureVMBackupConfig vmConfig, string snapshotTag, VirtualMachineExtensionBaseCmdlet virtualMachineExtensionBaseCmdlet)
        {
            var virtualMachineResponse            = virtualMachineExtensionBaseCmdlet.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(vmConfig.ResourceGroupName, vmConfig.VMName);
            StorageManagementClient storageClient = AzureSession.ClientFactory.CreateArmClient <StorageManagementClient>(virtualMachineExtensionBaseCmdlet.DefaultProfile.Context, AzureEnvironment.Endpoint.ResourceManager);

            StorageCredentialsFactory storageCredentialsFactory = new StorageCredentialsFactory(vmConfig.ResourceGroupName, storageClient, virtualMachineExtensionBaseCmdlet.DefaultProfile.Context.Subscription);

            List <string> blobUris = this.GetDiskBlobUris(virtualMachineResponse.Body);

            Dictionary <string, string> snapshotQuery = new Dictionary <string, string>();

            snapshotQuery.Add(backupExtensionMetadataName, snapshotTag);
            List <CloudPageBlob> snapshots = this.FindSnapshot(blobUris, snapshotQuery, storageCredentialsFactory);

            if (snapshots == null || snapshots.Count == 0)
            {
                throw new AzureVMBackupException(AzureVMBackupErrorCodes.NoSnapshotFound, "snapshot with the tag not found.");
            }
            else
            {
                foreach (CloudPageBlob snapshot in snapshots)
                {
                    snapshot.Delete();
                }
            }
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            AzureVMBackupExtensionUtil azureBackupExtensionUtil = new AzureVMBackupExtensionUtil();

            AzureVMBackupConfig vmConfig = new AzureVMBackupConfig();
            vmConfig.ResourceGroupName = ResourceGroupName;
            vmConfig.VMName = VMName;
            vmConfig.ExtensionName = Name;
            vmConfig.VirtualMachineExtensionType = VirtualMachineExtensionType;

            azureBackupExtensionUtil.CreateSnapshotForDisks(vmConfig,Tag, this);
        }
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            AzureVMBackupExtensionUtil azureBackupExtensionUtil = new AzureVMBackupExtensionUtil();

            AzureVMBackupConfig vmConfig = new AzureVMBackupConfig();
            vmConfig.ResourceGroupName = ResourceGroupName;
            vmConfig.VMName = this.VMName;
            vmConfig.ExtensionName = this.Name;
            vmConfig.VirtualMachineExtensionType = VirtualMachineExtensionType;

            azureBackupExtensionUtil.CreateSnapshotForDisks(vmConfig,Tag, this);
        }
예제 #4
0
        /// <summary>
        /// remove the vmbackups with the metadata  key "vmbackuptag" and value snapshotTag, snapshotTag is the parameter passed in.
        /// </summary>
        /// <param name="resourceGroupName"></param>
        /// <param name="vmName"></param>
        /// <param name="virtualMachineExtensionType"></param>
        /// <param name="location"></param>
        /// <param name="virtualMachineResponse"></param>
        /// <param name="profile"></param>
        /// <param name="VirtualMachineExtensionClient"></param>
        /// <param name="snapshotTag"></param>
        public void RemoveSnapshot(AzureVMBackupConfig vmConfig, string snapshotTag, VirtualMachineExtensionBaseCmdlet virtualMachineExtensionBaseCmdlet)
        {
            var virtualMachineResponse            = virtualMachineExtensionBaseCmdlet.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(vmConfig.ResourceGroupName, vmConfig.VMName);
            StorageManagementClient storageClient = AzureSession.ClientFactory.CreateClient <StorageManagementClient>(virtualMachineExtensionBaseCmdlet.DefaultProfile.Context, AzureEnvironment.Endpoint.ResourceManager);

            StorageCredentialsFactory storageCredentialsFactory = new StorageCredentialsFactory(vmConfig.ResourceGroupName, storageClient, virtualMachineExtensionBaseCmdlet.DefaultProfile.Context.Subscription);

            List <string> blobUris = this.GetDiskBlobUris(virtualMachineResponse.Body);

            Dictionary <string, string> snapshotQuery = new Dictionary <string, string>();
            List <CloudPageBlob>        snapshots     = this.FindSnapshot(blobUris, snapshotQuery, storageCredentialsFactory);

            foreach (CloudPageBlob snapshot in snapshots)
            {
                snapshot.Delete();
            }
        }
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            var virtualMachineResponse = this.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(this.ResourceGroupName, VMName);
            var currentOSType = virtualMachineResponse.Body.StorageProfile.OsDisk.OsType;

            if (OperatingSystemTypes.Linux.Equals(currentOSType))
            {
                AzureVMBackupExtensionUtil util = new AzureVMBackupExtensionUtil();
                AzureVMBackupConfig vmConfig = new AzureVMBackupConfig();
                vmConfig.ResourceGroupName = ResourceGroupName;
                vmConfig.VMName = VMName;
                vmConfig.VirtualMachineExtensionType = VirtualMachineExtensionType;
                util.RemoveSnapshot(vmConfig, Tag, this);
            }
            else
            {
                ThrowTerminatingError(new ErrorRecord(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, "The VM should be a Linux VM")),
                                                      "InvalidArgument",
                                                      ErrorCategory.InvalidArgument,
                                                      null));
            }
        }
예제 #6
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            VirtualMachineGetResponse virtualMachineResponse = this.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(this.ResourceGroupName, VMName);
            string currentOSType = virtualMachineResponse.VirtualMachine.StorageProfile.OSDisk.OperatingSystemType;

            if (string.Equals(currentOSType, "Linux", StringComparison.InvariantCultureIgnoreCase))
            {
                AzureVMBackupExtensionUtil util     = new AzureVMBackupExtensionUtil();
                AzureVMBackupConfig        vmConfig = new AzureVMBackupConfig();
                vmConfig.ResourceGroupName           = ResourceGroupName;
                vmConfig.VMName                      = VMName;
                vmConfig.VirtualMachineExtensionType = VirtualMachineExtensionType;
                util.RemoveSnapshot(vmConfig, Tag, this);
            }
            else
            {
                ThrowTerminatingError(new ErrorRecord(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, "The VM should be a Linux VM")),
                                                      "InvalidArgument",
                                                      ErrorCategory.InvalidArgument,
                                                      null));
            }
        }
예제 #7
0
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            var virtualMachineResponse = this.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(this.ResourceGroupName, VMName);
            var currentOSType          = virtualMachineResponse.Body.StorageProfile.OsDisk.OsType;

            if (OperatingSystemTypes.Linux.Equals(currentOSType))
            {
                AzureVMBackupExtensionUtil util     = new AzureVMBackupExtensionUtil();
                AzureVMBackupConfig        vmConfig = new AzureVMBackupConfig();
                vmConfig.ResourceGroupName           = ResourceGroupName;
                vmConfig.VMName                      = VMName;
                vmConfig.VirtualMachineExtensionType = VirtualMachineExtensionType;
                util.RemoveSnapshot(vmConfig, Tag, this);
            }
            else
            {
                ThrowTerminatingError(new ErrorRecord(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, "The VM should be a Linux VM")),
                                                      "InvalidArgument",
                                                      ErrorCategory.InvalidArgument,
                                                      null));
            }
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            VirtualMachineGetResponse virtualMachineResponse = this.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(this.ResourceGroupName, VMName);
            string currentOSType = virtualMachineResponse.VirtualMachine.StorageProfile.OSDisk.OperatingSystemType;

            if (string.Equals(currentOSType, "Linux", StringComparison.InvariantCultureIgnoreCase))
            {
                AzureVMBackupExtensionUtil util = new AzureVMBackupExtensionUtil();
                AzureVMBackupConfig vmConfig = new AzureVMBackupConfig();
                vmConfig.ResourceGroupName = ResourceGroupName;
                vmConfig.VMName = VMName;
                vmConfig.VirtualMachineExtensionType = VirtualMachineExtensionType;
                util.RemoveSnapshot(vmConfig, Tag, this);
            }
            else
            {
                ThrowTerminatingError(new ErrorRecord(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, "The VM should be a Linux VM")),
                                                      "InvalidArgument",
                                                      ErrorCategory.InvalidArgument,
                                                      null));
            }
        }
예제 #9
0
        /// <summary>
        /// we only support the Linux box now, if it's a windows, one AzureVMBackupException would be thrown.
        /// </summary>
        /// <param name="resourceGroupName"></param>
        /// <param name="vmName"></param>
        /// <param name="virtualMachineExtensionType"></param>
        /// <param name="location"></param>
        /// <param name="virtualMachineResponse"></param>
        /// <param name="snapshotTag"></param>
        /// <param name="virtualMachineExtensionBaseCmdlet"></param>
        public void CreateSnapshotForDisks(AzureVMBackupConfig vmConfig, string snapshotTag, VirtualMachineExtensionBaseCmdlet virtualMachineExtensionBaseCmdlet)
        {
            var virtualMachine = virtualMachineExtensionBaseCmdlet.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(
                vmConfig.ResourceGroupName,
                vmConfig.VMName);
            StorageManagementClient storageClient = AzureSession.ClientFactory.CreateArmClient <StorageManagementClient>(virtualMachineExtensionBaseCmdlet.DefaultProfile.Context, AzureEnvironment.Endpoint.ResourceManager);

            StorageCredentialsFactory storageCredentialsFactory = new StorageCredentialsFactory(vmConfig.ResourceGroupName, storageClient, virtualMachineExtensionBaseCmdlet.DefaultProfile.Context.Subscription);

            CloudPageBlobObjectFactory cloudPageBlobObjectFactory = new CloudPageBlobObjectFactory(storageCredentialsFactory, TimeSpan.FromMinutes(1));

            List <string> vmPageBlobUris = this.GetDiskBlobUris(virtualMachine.Body);

            AzureVMBackupBlobSasUris blobSASUris = this.GenerateBlobSasUris(vmPageBlobUris, cloudPageBlobObjectFactory);

            string taskId = Guid.NewGuid().ToString();

            AzureVMBackupExtensionProtectedSettings privateConfig = new AzureVMBackupExtensionProtectedSettings();

            privateConfig.logsBlobUri = string.Empty;
            privateConfig.objectStr   = this.GetBase64Encoding(blobSASUris);

            AzureVMBackupExtensionPublicSettings publicConfig = new AzureVMBackupExtensionPublicSettings();

            publicConfig.commandToExecute         = backupSnapshotCommand;
            publicConfig.locale                   = backupDefaultLocale;
            publicConfig.commandStartTimeUTCTicks = DateTimeOffset.UtcNow.Ticks.ToString();
            publicConfig.taskId                   = taskId;
            AzureVMBackupMetadata backupMetadata = new AzureVMBackupMetadata();

            AzureVMBackupMetadataItem tagMetadataItem = new AzureVMBackupMetadataItem();

            tagMetadataItem.Key   = backupExtensionMetadataName;
            tagMetadataItem.Value = snapshotTag;

            AzureVMBackupMetadataItem taskIdMetadataItem = new AzureVMBackupMetadataItem();

            taskIdMetadataItem.Key   = backupExtensionIdentityMetadataName;
            taskIdMetadataItem.Value = taskId;

            backupMetadata.backupMetadata.Add(tagMetadataItem);
            backupMetadata.backupMetadata.Add(taskIdMetadataItem);

            publicConfig.objectStr = this.GetBase64Encoding(backupMetadata);

            VirtualMachineExtension vmExtensionParameters = new VirtualMachineExtension
            {
                Location  = virtualMachine.Body.Location,
                Publisher = extensionPublisher,
                VirtualMachineExtensionType = extensionType,
                TypeHandlerVersion          = extensionDefaultVersion,
                Settings          = publicConfig,
                ProtectedSettings = privateConfig,
            };

            var vmBackupOperation = virtualMachineExtensionBaseCmdlet.VirtualMachineExtensionClient.CreateOrUpdate(
                vmConfig.ResourceGroupName,
                vmConfig.VMName,
                vmConfig.ExtensionName ?? backupExtensionName,
                vmExtensionParameters);

            // check the snapshots with the task id are all created.
            int timePeriod   = 5000;
            int loopingTimes = ((int)TimeSpan.FromMinutes(10).TotalMilliseconds / timePeriod);

            Dictionary <string, string> snapshotQuery = new Dictionary <string, string>();

            snapshotQuery.Add(backupExtensionMetadataName, snapshotTag);
            snapshotQuery.Add(backupExtensionIdentityMetadataName, taskId);
            int i = 0;

            for (; i < loopingTimes; i++)
            {
                List <CloudPageBlob> snapshotsFound = this.FindSnapshot(vmPageBlobUris, snapshotQuery, storageCredentialsFactory);
                if (snapshotsFound.Count == vmPageBlobUris.Count)
                {
                    break;
                }
                else
                {
                    Thread.Sleep(timePeriod);
                }
            }
            if (i == loopingTimes)
            {
                throw new AzureVMBackupException(AzureVMBackupErrorCodes.TimeOut, "snapshot not created, or not found in time.");
            }
        }
        /// <summary>
        /// we only support the Linux box now, if it's a windows, one AzureVMBackupException would be thrown.
        /// </summary>
        /// <param name="resourceGroupName"></param>
        /// <param name="vmName"></param>
        /// <param name="virtualMachineExtensionType"></param>
        /// <param name="location"></param>
        /// <param name="virtualMachineResponse"></param>
        /// <param name="snapshotTag"></param>
        /// <param name="virtualMachineExtensionBaseCmdlet"></param>
        public void CreateSnapshotForDisks(AzureVMBackupConfig vmConfig, string snapshotTag, VirtualMachineExtensionBaseCmdlet virtualMachineExtensionBaseCmdlet)
        {
            var virtualMachine = virtualMachineExtensionBaseCmdlet.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(
                vmConfig.ResourceGroupName,
                vmConfig.VMName);
            StorageManagementClient storageClient = AzureSession.ClientFactory.CreateClient<StorageManagementClient>(virtualMachineExtensionBaseCmdlet.DefaultProfile.Context, AzureEnvironment.Endpoint.ResourceManager);

            StorageCredentialsFactory storageCredentialsFactory = new StorageCredentialsFactory(vmConfig.ResourceGroupName, storageClient, virtualMachineExtensionBaseCmdlet.DefaultProfile.Context.Subscription);

            CloudPageBlobObjectFactory cloudPageBlobObjectFactory = new CloudPageBlobObjectFactory(storageCredentialsFactory, TimeSpan.FromMinutes(1));

            List<string> vmPageBlobUris = this.GetDiskBlobUris(virtualMachine.Body);

            AzureVMBackupBlobSasUris blobSASUris = this.GenerateBlobSasUris(vmPageBlobUris, cloudPageBlobObjectFactory);

            string taskId = Guid.NewGuid().ToString();

            AzureVMBackupExtensionProtectedSettings privateConfig = new AzureVMBackupExtensionProtectedSettings();
            privateConfig.logsBlobUri = string.Empty;
            privateConfig.objectStr = this.GetBase64Encoding(blobSASUris);

            AzureVMBackupExtensionPublicSettings publicConfig = new AzureVMBackupExtensionPublicSettings();
            publicConfig.commandToExecute = backupSnapshotCommand;
            publicConfig.locale = backupDefaultLocale;
            publicConfig.commandStartTimeUTCTicks = DateTimeOffset.UtcNow.Ticks.ToString();
            publicConfig.taskId = taskId;
            AzureVMBackupMetadata backupMetadata = new AzureVMBackupMetadata();

            AzureVMBackupMetadataItem tagMetadataItem = new AzureVMBackupMetadataItem();
            tagMetadataItem.Key = backupExtensionMetadataName;
            tagMetadataItem.Value = snapshotTag;

            AzureVMBackupMetadataItem taskIdMetadataItem = new AzureVMBackupMetadataItem();
            taskIdMetadataItem.Key = backupExtensionIdentityMetadataName;
            taskIdMetadataItem.Value = taskId;

            backupMetadata.backupMetadata.Add(tagMetadataItem);
            backupMetadata.backupMetadata.Add(taskIdMetadataItem);

            publicConfig.objectStr = this.GetBase64Encoding(backupMetadata);

            VirtualMachineExtension vmExtensionParameters = new VirtualMachineExtension
            {
                Location = virtualMachine.Body.Location,
                Publisher = extensionPublisher,
                VirtualMachineExtensionType = extensionType,
                TypeHandlerVersion = extensionDefaultVersion,
                Settings = publicConfig,
                ProtectedSettings = privateConfig,
            };

            var vmBackupOperation = virtualMachineExtensionBaseCmdlet.VirtualMachineExtensionClient.CreateOrUpdate(
                vmConfig.ResourceGroupName,
                vmConfig.VMName,
                vmConfig.ExtensionName ?? backupExtensionName,
                vmExtensionParameters);

            // check the snapshots with the task id are all created.
            int timePeriod = 5000;
            int loopingTimes = ((int)TimeSpan.FromMinutes(10).TotalMilliseconds / timePeriod);

            Dictionary<string, string> snapshotQuery = new Dictionary<string, string>();
            snapshotQuery.Add(backupExtensionMetadataName, snapshotTag);
            snapshotQuery.Add(backupExtensionIdentityMetadataName, taskId);
            int i = 0;
            for (; i < loopingTimes; i++)
            {
                List<CloudPageBlob> snapshotsFound = this.FindSnapshot(vmPageBlobUris, snapshotQuery, storageCredentialsFactory);
                if (snapshotsFound.Count == vmPageBlobUris.Count)
                {
                    break;
                }
                else
                {
                    Thread.Sleep(timePeriod);
                }
            }
            if (i == loopingTimes)
            {
                throw new AzureVMBackupException(AzureVMBackupErrorCodes.TimeOut, "snapshot not created, or not found in time.");
            }
        }
        /// <summary>
        /// remove the vmbackups with the metadata  key "vmbackuptag" and value snapshotTag, snapshotTag is the parameter passed in.
        /// </summary>
        /// <param name="resourceGroupName"></param>
        /// <param name="vmName"></param>
        /// <param name="virtualMachineExtensionType"></param>
        /// <param name="location"></param>
        /// <param name="virtualMachineResponse"></param>
        /// <param name="profile"></param>
        /// <param name="VirtualMachineExtensionClient"></param>
        /// <param name="snapshotTag"></param>
        public void RemoveSnapshot(AzureVMBackupConfig vmConfig, string snapshotTag, VirtualMachineExtensionBaseCmdlet virtualMachineExtensionBaseCmdlet)
        {
            var virtualMachineResponse = virtualMachineExtensionBaseCmdlet.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(vmConfig.ResourceGroupName, vmConfig.VMName);
            StorageManagementClient storageClient = AzureSession.ClientFactory.CreateClient<StorageManagementClient>(virtualMachineExtensionBaseCmdlet.DefaultProfile.Context, AzureEnvironment.Endpoint.ResourceManager);

            StorageCredentialsFactory storageCredentialsFactory = new StorageCredentialsFactory(vmConfig.ResourceGroupName, storageClient, virtualMachineExtensionBaseCmdlet.DefaultProfile.Context.Subscription);

            List<string> blobUris = this.GetDiskBlobUris(virtualMachineResponse.Body);

            Dictionary<string, string> snapshotQuery = new Dictionary<string, string>();
            List<CloudPageBlob> snapshots = this.FindSnapshot(blobUris, snapshotQuery, storageCredentialsFactory);
            foreach (CloudPageBlob snapshot in snapshots)
            {
                snapshot.Delete();
            }
        }
     private void CreateVMBackupForLinx()
     {
         try
         {
             AzureVMBackupExtensionUtil azureBackupExtensionUtil = new AzureVMBackupExtensionUtil();
             AzureVMBackupConfig vmConfig = new AzureVMBackupConfig();
             vmConfig.ResourceGroupName = ResourceGroupName;
             vmConfig.VMName = VMName;
             vmConfig.VirtualMachineExtensionType = VirtualMachineExtensionType;
             string tag = string.Format("{0}{1}", "AzureEnc", Guid.NewGuid().ToString());
             // this would create shapshot only for Linux box. and we should wait for the snapshot found.
             azureBackupExtensionUtil.CreateSnapshotForDisks(vmConfig, tag, this);
             WriteWarning(string.Format("one snapshot for disks are created with tag,{0}, you can use {1}-{2} to remove it.", tag, VerbsCommon.Remove,
 ProfileNouns.AzureVMBackup));
         }
         catch (AzureVMBackupException e)
         {
             ThrowTerminatingError(new ErrorRecord(new ApplicationException(string.Format(CultureInfo.CurrentUICulture, e.ToString())),
                                                   "InvalidResult",
                                                   ErrorCategory.InvalidResult,
                                                   null));
         }
     }
        /// <summary>
        /// remove the vmbackups with the metadata  key "vmbackuptag" and value snapshotTag, snapshotTag is the parameter passed in.
        /// </summary>
        /// <param name="resourceGroupName"></param>
        /// <param name="vmName"></param>
        /// <param name="virtualMachineExtensionType"></param>
        /// <param name="location"></param>
        /// <param name="virtualMachineResponse"></param>
        /// <param name="profile"></param>
        /// <param name="VirtualMachineExtensionClient"></param>
        /// <param name="snapshotTag"></param>
        public void RemoveSnapshot(AzureVMBackupConfig vmConfig, string snapshotTag, VirtualMachineExtensionBaseCmdlet virtualMachineExtensionBaseCmdlet)
        {
            var virtualMachineResponse = virtualMachineExtensionBaseCmdlet.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(vmConfig.ResourceGroupName, vmConfig.VMName);
            StorageManagementClient storageClient = AzureSession.ClientFactory.CreateArmClient<StorageManagementClient>(virtualMachineExtensionBaseCmdlet.DefaultProfile.Context, AzureEnvironment.Endpoint.ResourceManager);

            StorageCredentialsFactory storageCredentialsFactory = new StorageCredentialsFactory(vmConfig.ResourceGroupName, storageClient, virtualMachineExtensionBaseCmdlet.DefaultProfile.Context.Subscription);

            List<string> blobUris = this.GetDiskBlobUris(virtualMachineResponse.Body);
            AzureVMBackupBlobSasUris blobSASUris = this.GenerateBlobSasUris(blobUris, virtualMachineExtensionBaseCmdlet.DefaultProfile.Context);

            Dictionary<string, string> snapshotQuery = new Dictionary<string, string>();
            snapshotQuery.Add(backupExtensionMetadataName, snapshotTag);
            List<CloudPageBlob> snapshots = this.FindSnapshot(virtualMachineExtensionBaseCmdlet.DefaultProfile.Context, blobSASUris.pageBlobUri, blobSASUris.storageCredentialsFactory, snapshotQuery);
            if (snapshots == null || snapshots.Count == 0)
            {
                throw new AzureVMBackupException(AzureVMBackupErrorCodes.NoSnapshotFound, "snapshot with the tag not found.");
            }
            else
            {
                foreach (CloudPageBlob snapshot in snapshots)
                {
                    snapshot.Delete();
                }
            }
        }