0
Windows Azure Drive
Pavlo Revenkov
EPAM Cloud Computing Competency Center
Email: pavlo_revenkov@epam.com
Skype: rp_risings...
Data management services

2

Web-role Worker-role
Worker-role

Worker-role

Web-role

Drive

SQL Azure

Blobs

Tables
Queu...
Example: CMS

3

Publishers

Instance 1

Author

Instance 2

Instance 3

Mount
30 minutes
Snapshot

Repository

Instance 4
Windows Azure Drive

4

Subscription

Storage Account
(100 ТВ)

Storage Account
(100 ТВ)

Container
Block Blob (200 GB)
Co...
Blob content upload
var storageAccount = CloudStorageAccount.Parse(
ConfigurationManager
.ConnectionStrings[ConnectionStri...
1. public static void UploadVHDFile(string filePath, string containerName, string blobName)
2. {
3.
const int partSize = 1...
Modes

7
CloudDrive
client

Snapshot

URL
Mount

Exception

Mount

Yes
Author

Lease mode

Snapshot mode

read

write

rea...
Workflow
var account = CloudStorageAccount.Parse(
ConfigurationManager.AppSettings["ConnectionString“]);
var drive = new C...
Demo

9
References

Differences Between the Storage Emulator and
Windows Azure Storage Services
 http://msdn.microsoft.com/en-us/...
Questions?

11
Upcoming SlideShare
Loading in...5
×

Windows Azure Drive

419

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
419
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Windows Azure Drive"

  1. 1. Windows Azure Drive Pavlo Revenkov EPAM Cloud Computing Competency Center Email: pavlo_revenkov@epam.com Skype: rp_risingstar Habrahabr: habrahabr.ru/users/risingstar/
  2. 2. Data management services 2 Web-role Worker-role Worker-role Worker-role Web-role Drive SQL Azure Blobs Tables Queues
  3. 3. Example: CMS 3 Publishers Instance 1 Author Instance 2 Instance 3 Mount 30 minutes Snapshot Repository Instance 4
  4. 4. Windows Azure Drive 4 Subscription Storage Account (100 ТВ) Storage Account (100 ТВ) Container Block Blob (200 GB) Container Page Blob (1 ТВ) Storage Account (100 ТВ) Storage Account (100 ТВ) … Container … Azure Drive (1 ТВ) …
  5. 5. Blob content upload var storageAccount = CloudStorageAccount.Parse( ConfigurationManager .ConnectionStrings[ConnectionStringSetting] .ConnectionString); var blobClient = storageAccount.CreateCloudBlobClient(); var container = blobClient.GetContainerReference(containerName); var pageBlob = container.GetPageBlobReference(blobName); using (var fileStream = new FileStream(filePath, FileMode.Open)) { pageBlob.Create(fileStream.Length); var buffer = new byte[partSize]; while (offset < fileStream.Length) { var bytesRead = fileStream.Read(buffer, 0, partSize); pageBlob.WritePages(new MemoryStream(buffer, 0, bytesRead), offset); offset += bytesRead; } } 5
  6. 6. 1. public static void UploadVHDFile(string filePath, string containerName, string blobName) 2. { 3. const int partSize = 1024 * 1024; 4. 5. var storageAccount = CloudStorageAccount.Parse( 6. ConfigurationManager.ConnectionStrings[ConnectionStringSetting].ConnectionString); 7. 8. var blobClient = storageAccount.CreateCloudBlobClient(); 9. var container = blobClient.GetContainerReference(containerName); 10. container.CreateIfNotExist(); 11. 12. var pageBlob = container.GetPageBlobReference(blobName); 13. pageBlob.DeleteIfExists(); 14. pageBlob.Properties.ContentType = "binary/octet-stream"; 15. 16. using (var fileStream = new FileStream(filePath, FileMode.Open)) 17. { 18. int offset = 0; 19. 20. pageBlob.Create(fileStream.Length); 21. 22. var buffer = new byte[partSize]; 23. while (offset < fileStream.Length) 24. { 25. var bytesRead = fileStream.Read(buffer, 0, partSize); 26. 27. pageBlob.WritePages(new MemoryStream(buffer, 0, bytesRead), offset); 28. 29. offset += bytesRead; 30. 31. Console.Write('.'); 32. } 33. } 34. } 6
  7. 7. Modes 7 CloudDrive client Snapshot URL Mount Exception Mount Yes Author Lease mode Snapshot mode read write read Windows Azure Drive Publisher
  8. 8. Workflow var account = CloudStorageAccount.Parse( ConfigurationManager.AppSettings["ConnectionString“]); var drive = new CloudDrive(blobUri, account.Credentials.*); try { drive.Mount(0, DriveMountOptions.None); ... } catch (CloudDriveException e) { drive = new CloudDrive(new Uri(drive.Snapshot().AbsoluteUri), ...); drive.Mount(0, DriveMountOptions.None); } finally { drive.Unmount(); } 8
  9. 9. Demo 9
  10. 10. References Differences Between the Storage Emulator and Windows Azure Storage Services  http://msdn.microsoft.com/en-us/gg433135 Windows Azure Drive whitepaper  http://go.microsoft.com/?linkid=9710117 10
  11. 11. Questions? 11
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×