我们的连接速度非常慢且硬盘非常小,如何在 azure 上为云驱动器创建 1 TB VHD?
最佳答案
您需要上传现有的 VHD 还是只需要 1 TB Azure 驱动器用于云中的应用程序?如果是前者,里纳特可能是对的。查看这篇博客文章,了解如何编写控制台应用程序:blogs.msdn.com/b/windowsazurestorage/archive/2010/04/11/using-windows-azure-page-blobs-and-how-to-efficiently-upload-and-download-page-blobs.aspx .
但是,如果您的应用程序只需要 1 TB Azure 驱动器,则可以使用在云中运行的代码创建一个驱动器。您可以编写类似于我在下面编写的代码:
string pageBlobName = "testpageblob";// Guid.NewGuid().ToString();
string blobUri = string.Format("{0}/{1}", blobContainer.Uri.AbsoluteUri,
pageBlobName);
CloudDrive cloudDrive = new CloudDrive(new Uri(blobUri), csa.Credentials);
for (int i = 0; i < 30; i++)
{
try
{
cloudDrive.Create(20);
break;
}
catch (CloudDriveException ex)
{
if (!ex.Message.Equals("ERROR_UNSUPPORTED_OS") || i == 29)
throw;
Thread.Sleep(10000);
}
}
string driveLetter = cloudDrive.Mount(25, DriveMountOptions.Force);
关于 azure VHD 1TB 上传,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4829820/