diff --git a/XenAdmin/Controls/MultipleDvdIsoList.cs b/XenAdmin/Controls/MultipleDvdIsoList.cs
index 9a8f22bfc..621023d36 100644
--- a/XenAdmin/Controls/MultipleDvdIsoList.cs
+++ b/XenAdmin/Controls/MultipleDvdIsoList.cs
@@ -251,17 +251,26 @@ private void comboBoxDrive_SelectedIndexChanged(object sender, EventArgs e)
cdChanger1.Drive = (comboBoxDrive.SelectedItem as VbdCombiItem)?.Vbd;
}
-
private void newCDLabel_Click(object sender, EventArgs e)
{
- if (VM != null)
- {
- var createDriveAction = new CreateCdDriveAction(VM);
- createDriveAction.ShowUserInstruction += CreateDriveAction_ShowUserInstruction;
+ if (VM == null)
+ return;
- using (var dlg = new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee))
- dlg.ShowDialog(this);
+ if (VM.IsHVM())
+ {
+ using (var dialog = new WarningDialog(
+ string.Format(Messages.NEW_DVD_DRIVE_CREATE_CONFIRMATION, VM.Name()),
+ new ThreeButtonDialog.TBDButton(Messages.NEW_DVD_DRIVE_CREATE_YES_BUTTON, DialogResult.Yes, ThreeButtonDialog.ButtonType.ACCEPT, true),
+ ThreeButtonDialog.ButtonNo))
+ if (dialog.ShowDialog(Program.MainWindow) != DialogResult.Yes)
+ return;
}
+
+ var createDriveAction = new CreateCdDriveAction(VM);
+ createDriveAction.ShowUserInstruction += CreateDriveAction_ShowUserInstruction;
+
+ using (var dlg = new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee))
+ dlg.ShowDialog(this);
}
private void CreateDriveAction_ShowUserInstruction(string message)
diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs
index bf9759448..54493ad62 100755
--- a/XenModel/Messages.Designer.cs
+++ b/XenModel/Messages.Designer.cs
@@ -26209,6 +26209,17 @@ public static string NEVER {
}
}
+ ///
+ /// Looks up a localized string similar to Are you sure you want to create a new DVD drive on VM '{0}'?
+ ///
+ ///This action will create a new Virtual Block Device (VBD) that cannot be hot-unplugged..
+ ///
+ public static string NEW_DVD_DRIVE_CREATE_CONFIRMATION {
+ get {
+ return ResourceManager.GetString("NEW_DVD_DRIVE_CREATE_CONFIRMATION", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Creating new DVD drive on VM {0}.
///
@@ -26218,6 +26229,15 @@ public static string NEW_DVD_DRIVE_CREATE_TITLE {
}
}
+ ///
+ /// Looks up a localized string similar to &Yes, Create.
+ ///
+ public static string NEW_DVD_DRIVE_CREATE_YES_BUTTON {
+ get {
+ return ResourceManager.GetString("NEW_DVD_DRIVE_CREATE_YES_BUTTON", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Creating new DVD drive.
///
diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx
index c0ca9f592..3b79cc813 100755
--- a/XenModel/Messages.resx
+++ b/XenModel/Messages.resx
@@ -9101,6 +9101,14 @@ You should only proceed if you have verified that these settings are correct.
Never
+
+ Are you sure you want to create a new DVD drive on VM '{0}'?
+
+This action will create a new Virtual Block Device (VBD) that cannot be hot-unplugged.
+
+
+ &Yes, Create
+
Creating new DVD drive on VM {0}