Skip to content

Hot fix for New-AzureVM and Export-AzureVM #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,20 @@ public SetAzureDataDiskConfig(HostCaching hostCaching, int lun)

public PersistentVM Vm { get; set; }
}

public class SetAzureDataDiskResizeConfig
{
public string DiskName;

public int ResizedSizeInGB;
public PersistentVM Vm { get; set; }

public SetAzureDataDiskResizeConfig(string diskName, int resize, PersistentVM vm)
{
this.DiskName = diskName;
this.ResizedSizeInGB = resize;
this.Vm = vm;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ public void Initialize()
public void AzureDiskTest()
{
StartTest(MethodBase.GetCurrentMethod().Name, testStartTime);
string blobName = "os0.vhd";

vhdName = Utilities.GetUniqueShortName("os0vhd");
string mediaLocation = String.Format("{0}{1}/{2}", blobUrlRoot, vhdContainerName, blobName);
CopyCommonVhd(vhdContainerName, "os0.vhd", vhdName);

string mediaLocation = String.Format("{0}{1}/{2}", blobUrlRoot, vhdContainerName, vhdName);

try
{
Expand Down Expand Up @@ -114,7 +116,7 @@ public void AzureDiskTest()
Console.WriteLine("Disk Label is successfully updated");

// Update only size
int newSize = 250;
int newSize = 50;
vmPowershellCmdlets.UpdateAzureDisk(vhdName, null, newSize);

virtualDisk = vmPowershellCmdlets.GetAzureDisk(vhdName)[0];
Expand All @@ -126,7 +128,7 @@ public void AzureDiskTest()

// Update both label and size
newLabel = "NewLabel2";
newSize = 300;
newSize = 100;
vmPowershellCmdlets.UpdateAzureDisk(vhdName, newLabel, newSize);

virtualDisk = vmPowershellCmdlets.GetAzureDisk(vhdName)[0];
Expand All @@ -136,7 +138,7 @@ public void AzureDiskTest()
Assert.AreEqual(newSize, virtualDisk.DiskSizeInGB);
Console.WriteLine("Both disk label and size are successfully updated");

vmPowershellCmdlets.RemoveAzureDisk(vhdName, false);
vmPowershellCmdlets.RemoveAzureDisk(vhdName, true);
Assert.IsTrue(Utilities.CheckRemove(vmPowershellCmdlets.GetAzureDisk, vhdName), "The disk was not removed");
pass = true;
}
Expand All @@ -151,7 +153,7 @@ public void AzureDiskTest()

try
{
vmPowershellCmdlets.RemoveAzureDisk(vhdName, false);
vmPowershellCmdlets.RemoveAzureDisk(vhdName, true);
}
catch (Exception cleanupError)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,19 +285,22 @@ public void ValidateAvailableExtesnion(VirtualMachineExtensionImageContext exten
Assert.IsFalse(string.IsNullOrEmpty(extension.Publisher));
Assert.IsFalse(string.IsNullOrEmpty(extension.Version));

switch (extension.ExtensionName)
if (! extension.IsJsonExtension)
{
case "DiagnosticsAgent":
{
Assert.IsFalse(string.IsNullOrEmpty(extension.PublicConfigurationSchema));
break;
}
case "VMAccessAgent":
{
Assert.IsFalse(string.IsNullOrEmpty(extension.PublicConfigurationSchema));
Assert.IsFalse(string.IsNullOrEmpty(extension.PrivateConfigurationSchema));
break;
}
switch (extension.ExtensionName)
{
case "DiagnosticsAgent":
{
Assert.IsFalse(string.IsNullOrEmpty(extension.PublicConfigurationSchema));
break;
}
case "VMAccessAgent":
{
Assert.IsFalse(string.IsNullOrEmpty(extension.PublicConfigurationSchema));
Assert.IsFalse(string.IsNullOrEmpty(extension.PrivateConfigurationSchema));
break;
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ public SetAzureDataDiskCmdletInfo(SetAzureDataDiskConfig discCfg)
this.cmdletParams.Add(new CmdletParam("HostCaching", discCfg.hostCaching));
this.cmdletParams.Add(new CmdletParam("LUN", discCfg.lun));
this.cmdletParams.Add(new CmdletParam("VM", discCfg.Vm));
}

public SetAzureDataDiskCmdletInfo(SetAzureDataDiskResizeConfig discCfg)
{
cmdletName = Utilities.SetAzureDataDiskCmdletName;

this.cmdletParams.Add(new CmdletParam("DiskName", discCfg.DiskName));
this.cmdletParams.Add(new CmdletParam("ResizedSizeInGB", discCfg.ResizedSizeInGB));
this.cmdletParams.Add(new CmdletParam("VM", discCfg.Vm));
}
}
}
Loading