XSI-1107/CA-237939: Do not offer full disk copy when creating a VM from a snapshot.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2021-09-11 02:20:31 +01:00
parent 1936b74030
commit 7d9bbbc68b

View File

@ -274,9 +274,11 @@ namespace XenAdmin.Wizards.NewVMWizard
DisksGridView.Enabled = DisksRadioButton.Checked; DisksGridView.Enabled = DisksRadioButton.Checked;
DisklessVMRadioButton.Enabled = Template.IsHVM() && SelectedInstallMethod == InstallMethod.Network; DisklessVMRadioButton.Enabled = Template.IsHVM() && SelectedInstallMethod == InstallMethod.Network;
CloneCheckBox.Enabled = false; bool isDefaultTemplate = Template.DefaultTemplate();
bool isSnapshot = Template.is_a_snapshot;
bool createOnSameSr = false;
if (!Template.DefaultTemplate()) if (!isDefaultTemplate)
{ {
foreach (DiskGridRowItem row in DisksGridView.Rows) foreach (DiskGridRowItem row in DisksGridView.Rows)
{ {
@ -286,19 +288,15 @@ namespace XenAdmin.Wizards.NewVMWizard
if (row.SourceSR.Equals(dest)) if (row.SourceSR.Equals(dest))
{ {
CloneCheckBox.Enabled = true; createOnSameSr = true;
if (pageLoad)
CloneCheckBox.Checked = true;
break; break;
} }
} }
} }
} }
if (!CloneCheckBox.Enabled) CloneCheckBox.Enabled = createOnSameSr && !isSnapshot;
CloneCheckBox.Checked = false; CloneCheckBox.Checked = createOnSameSr && (isSnapshot || pageLoad);
OnPageUpdated(); OnPageUpdated();
} }