diff --git a/XenAdmin/Commands/MigrateVirtualDiskCommand.cs b/XenAdmin/Commands/MigrateVirtualDiskCommand.cs index 32f75b901..778f4ae07 100644 --- a/XenAdmin/Commands/MigrateVirtualDiskCommand.cs +++ b/XenAdmin/Commands/MigrateVirtualDiskCommand.cs @@ -74,7 +74,7 @@ namespace XenAdmin.Commands } else { - new MoveVirtualDiskDialog(selection.FirstAsXenObject.Connection, null, vdis).Show(Program.MainWindow); + new MigrateVirtualDiskDialog(selection.FirstAsXenObject.Connection, vdis).Show(Program.MainWindow); } } diff --git a/XenAdmin/Commands/MoveVirtualDiskCommand.cs b/XenAdmin/Commands/MoveVirtualDiskCommand.cs index f68eaed36..df43502b6 100644 --- a/XenAdmin/Commands/MoveVirtualDiskCommand.cs +++ b/XenAdmin/Commands/MoveVirtualDiskCommand.cs @@ -64,7 +64,7 @@ namespace XenAdmin.Commands protected override void ExecuteCore(SelectedItemCollection selection) { var vdis = selection.AsXenObjects(); - new MoveVirtualDiskDialog(selection.GetConnectionOfFirstItem(), vdis, null).Show(Program.MainWindow); + new MoveVirtualDiskDialog(selection.GetConnectionOfFirstItem(), vdis).Show(Program.MainWindow); } protected override bool CanExecuteCore(SelectedItemCollection selection) @@ -76,13 +76,14 @@ namespace XenAdmin.Commands { if (vdi == null || vdi.is_a_snapshot || vdi.Locked || vdi.IsHaType() || vdi.cbt_enabled) return false; - if (vdi.VBDs.Count != 0) - return false; SR sr = vdi.Connection.Resolve(vdi.SR); if (sr == null || sr.HBALunPerVDI()) return false; + if (vdi.GetVMs().Any(vm => vm.power_state != vm_power_state.Halted)) + return false; + return true; } @@ -102,8 +103,6 @@ namespace XenAdmin.Commands return Messages.CANNOT_MOVE_CBT_ENABLED_VDI; if (vdi.IsMetadataForDR()) return Messages.CANNOT_MOVE_DR_VD; - if (vdi.VBDs.Count != 0) - return Messages.CANNOT_MOVE_VDI_WITH_VBDS; SR sr = vdi.Connection.Resolve(vdi.SR); if (sr == null) diff --git a/XenAdmin/Dialogs/MoveVirtualDiskDialog.Designer.cs b/XenAdmin/Dialogs/MoveVirtualDiskDialog.Designer.cs index 5b8d1d2b9..595c66b06 100644 --- a/XenAdmin/Dialogs/MoveVirtualDiskDialog.Designer.cs +++ b/XenAdmin/Dialogs/MoveVirtualDiskDialog.Designer.cs @@ -29,7 +29,6 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MoveVirtualDiskDialog)); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.label1 = new System.Windows.Forms.Label(); this.toolTipContainer2 = new XenAdmin.Controls.ToolTipContainer(); this.buttonMove = new System.Windows.Forms.Button(); @@ -41,11 +40,6 @@ this.tableLayoutPanel2.SuspendLayout(); this.SuspendLayout(); // - // tableLayoutPanel1 - // - resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - // // label1 // resources.ApplyResources(this.label1, "label1"); @@ -73,7 +67,7 @@ this.srPicker1.Name = "srPicker1"; this.srPicker1.ItemSelectionNull += new System.Action(this.srPicker1_ItemSelectionNull); this.srPicker1.ItemSelectionNotNull += new System.Action(this.srPicker1_ItemSelectionNotNull); - this.srPicker1.DoubleClickOnRow += new System.EventHandler(this.SRPicker_DoubleClickOnRow); + this.srPicker1.DoubleClickOnRow += new System.EventHandler(this.srPicker1_DoubleClickOnRow); // // tableLayoutPanel2 // @@ -116,7 +110,6 @@ #endregion - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.Label label1; private XenAdmin.Controls.ToolTipContainer toolTipContainer2; private System.Windows.Forms.Button buttonMove; diff --git a/XenAdmin/Dialogs/MoveVirtualDiskDialog.cs b/XenAdmin/Dialogs/MoveVirtualDiskDialog.cs index b263c3d3a..86922fd80 100644 --- a/XenAdmin/Dialogs/MoveVirtualDiskDialog.cs +++ b/XenAdmin/Dialogs/MoveVirtualDiskDialog.cs @@ -32,21 +32,20 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using XenAdmin.Controls; -using XenAdmin.Network; -using XenAPI; using XenAdmin.Actions; +using XenAdmin.Network; using XenAdmin.Commands; +using XenAdmin.Controls; +using XenAdmin.Core; +using XenAPI; namespace XenAdmin.Dialogs { public partial class MoveVirtualDiskDialog : XenDialogBase { - private const int BATCH_SIZE = 3; - - private readonly List _vdisToMove; - private readonly List _vdisToMigrate; + protected const int BATCH_SIZE = 3; + + protected readonly List _vdis= new List(); /// /// Designer support only. Do not use. @@ -56,39 +55,36 @@ namespace XenAdmin.Dialogs InitializeComponent(); } - public MoveVirtualDiskDialog(IXenConnection connection, List vdisToMove, List vdisToMigrate) + public MoveVirtualDiskDialog(IXenConnection connection, List vdis) : base(connection) { InitializeComponent(); + _vdis = vdis ?? new List(); + } - //set those so we don't have to bother with null checks further down - _vdisToMove = vdisToMove ?? new List(); - _vdisToMigrate = vdisToMigrate ?? new List(); - - if (_vdisToMove.Count > 0) - { - srPicker1.Usage = SrPicker.SRPickerType.MoveOrCopy; - srPicker1.SetExistingVDIs(_vdisToMove.ToArray()); - srPicker1.DiskSize = _vdisToMove.Sum(d => d.physical_utilisation); - } - else if (_vdisToMigrate.Count > 0) - { - srPicker1.Usage = SrPicker.SRPickerType.Migrate; - srPicker1.SetExistingVDIs(_vdisToMigrate.ToArray()); - srPicker1.DiskSize = _vdisToMigrate.Sum(d => d.physical_utilisation); - } + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + srPicker1.Usage = SrPickerType; + srPicker1.SetExistingVDIs(_vdis.ToArray()); + srPicker1.DiskSize = _vdis.Sum(d => d.physical_utilisation); srPicker1.SrHint.Visible = false; srPicker1.Connection = connection; srPicker1.srListBox.Invalidate(); srPicker1.selectDefaultSROrAny(); } - private SR SelectedSR + protected SR SelectedSR { get { return srPicker1.SR; } } - + + protected virtual SrPicker.SRPickerType SrPickerType + { + get { return SrPicker.SRPickerType.MoveOrCopy; } + } + private void srPicker1_ItemSelectionNull() { updateButtons(); @@ -99,7 +95,7 @@ namespace XenAdmin.Dialogs updateButtons(); } - void SRPicker_DoubleClickOnRow(object sender, EventArgs e) + private void srPicker1_DoubleClickOnRow(object sender, EventArgs e) { if (buttonMove.Enabled) buttonMove.PerformClick(); @@ -121,32 +117,17 @@ namespace XenAdmin.Dialogs Close(); } - private void CreateAndRunParallelActions() + protected virtual void CreateAndRunParallelActions() { - if (_vdisToMigrate.Count == 1) + if (_vdis.Count == 1) { - new MigrateVirtualDiskAction(connection, _vdisToMigrate[0], SelectedSR).RunAsync(); + new MoveVirtualDiskAction(connection, _vdis[0], SelectedSR).RunAsync(); } - else if (_vdisToMigrate.Count > 1) + else if (_vdis.Count > 1) { - string title = string.Format(Messages.ACTION_MIGRATING_X_VDIS, _vdisToMigrate.Count, SelectedSR.name_label); + string title = string.Format(Messages.ACTION_MOVING_X_VDIS, _vdis.Count, SelectedSR.name_label); - var batch = from VDI vdi in _vdisToMigrate - select (AsyncAction)new MigrateVirtualDiskAction(connection, vdi, SelectedSR); - - new ParallelAction(connection, title, Messages.ACTION_MIGRATING_X_VDIS_STARTED, - Messages.ACTION_MIGRATING_X_VDIS_COMPLETED, batch.ToList(), BATCH_SIZE).RunAsync(); - } - - if (_vdisToMove.Count == 1) - { - new MoveVirtualDiskAction(connection, _vdisToMove[0], SelectedSR).RunAsync(); - } - else if (_vdisToMove.Count > 1) - { - string title = string.Format(Messages.ACTION_MOVING_X_VDIS, _vdisToMove.Count, SelectedSR.name_label); - - var batch = from VDI vdi in _vdisToMove + var batch = from VDI vdi in _vdis select (AsyncAction)new MoveVirtualDiskAction(connection, vdi, SelectedSR); new ParallelAction(connection, title, Messages.ACTION_MOVING_X_VDIS_STARTED, @@ -159,14 +140,47 @@ namespace XenAdmin.Dialogs get { return "VDIMigrateDialog"; } } - internal static Command MoveMigrateCommand(IMainWindow mainWindow, IEnumerable selection) + internal static Command MoveMigrateCommand(IMainWindow mainWindow, SelectedItemCollection selection) { var cmd = new MigrateVirtualDiskCommand(mainWindow, selection); + var con = selection.GetConnectionOfFirstItem(); - if (cmd.CanExecute()) + if (cmd.CanExecute() && !Helpers.FeatureForbidden(con, Host.RestrictCrossPoolMigrate)) return cmd; return new MoveVirtualDiskCommand(mainWindow, selection); } } + + + public class MigrateVirtualDiskDialog : MoveVirtualDiskDialog + { + public MigrateVirtualDiskDialog(IXenConnection connection, List vdis) + : base(connection, vdis) + { + } + + protected override SrPicker.SRPickerType SrPickerType + { + get { return SrPicker.SRPickerType.Migrate; } + } + + protected override void CreateAndRunParallelActions() + { + if (_vdis.Count == 1) + { + new MigrateVirtualDiskAction(connection, _vdis[0], SelectedSR).RunAsync(); + } + else if (_vdis.Count > 1) + { + string title = string.Format(Messages.ACTION_MIGRATING_X_VDIS, _vdis.Count, SelectedSR.name_label); + + var batch = from VDI vdi in _vdis + select (AsyncAction)new MigrateVirtualDiskAction(connection, vdi, SelectedSR); + + new ParallelAction(connection, title, Messages.ACTION_MIGRATING_X_VDIS_STARTED, + Messages.ACTION_MIGRATING_X_VDIS_COMPLETED, batch.ToList(), BATCH_SIZE).RunAsync(); + } + } + } } diff --git a/XenAdmin/Dialogs/MoveVirtualDiskDialog.resx b/XenAdmin/Dialogs/MoveVirtualDiskDialog.resx index bb5959fb1..e6ed86651 100644 --- a/XenAdmin/Dialogs/MoveVirtualDiskDialog.resx +++ b/XenAdmin/Dialogs/MoveVirtualDiskDialog.resx @@ -117,45 +117,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Top, Bottom, Left, Right - - - 1 - - - - Segoe UI, 9pt - - - 0, 0 - - - 2 - - - 200, 100 - - - 0 - - - tableLayoutPanel1 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Absolute,20" /><Rows Styles="Absolute,20,Absolute,20" /></TableLayoutSettings> - True + Fill + Segoe UI, 9pt @@ -217,7 +187,7 @@ 75, 25 - 2 + 0 &Move @@ -244,7 +214,7 @@ 75, 25 - 8 + 2 toolTipContainer2 @@ -264,9 +234,6 @@ 2 - - Bottom, Right - True @@ -289,7 +256,7 @@ 75, 25 - 6 + 3 Cancel @@ -328,7 +295,7 @@ 507, 25 - 2 + 0 Select the storage repository that you would like to move the virtual disk to: @@ -361,7 +328,7 @@ 513, 246 - 7 + 0 tableLayoutPanel2 diff --git a/XenAdmin/TabPages/PhysicalStoragePage.Designer.cs b/XenAdmin/TabPages/PhysicalStoragePage.Designer.cs index 03a7a80cc..7db1a66b4 100755 --- a/XenAdmin/TabPages/PhysicalStoragePage.Designer.cs +++ b/XenAdmin/TabPages/PhysicalStoragePage.Designer.cs @@ -39,33 +39,31 @@ namespace XenAdmin.TabPages this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.labelNetworkheadings = new System.Windows.Forms.Label(); this.TitleLabel = new System.Windows.Forms.Label(); - this.panel1 = new System.Windows.Forms.Panel(); - this.dataGridViewSr = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); - this.columnImage = new System.Windows.Forms.DataGridViewImageColumn(); - this.columnName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnDescription = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnType = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnShared = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnUsage = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnSize = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnVirtAlloc = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnSize = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnUsage = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnShared = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnType = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnDescription = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnImage = new System.Windows.Forms.DataGridViewImageColumn(); + this.dataGridViewSr = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.newSRButton = new XenAdmin.Commands.CommandButton(); this.trimButtonContainer = new XenAdmin.Controls.ToolTipContainer(); this.trimButton = new XenAdmin.Commands.CommandButton(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); this.buttonProperties = new System.Windows.Forms.Button(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.pageContainerPanel.SuspendLayout(); - this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewSr)).BeginInit(); this.flowLayoutPanel1.SuspendLayout(); this.trimButtonContainer.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // pageContainerPanel // - this.pageContainerPanel.Controls.Add(this.panel1); - this.pageContainerPanel.Controls.Add(this.labelNetworkheadings); + this.pageContainerPanel.Controls.Add(this.tableLayoutPanel1); resources.ApplyResources(this.pageContainerPanel, "pageContainerPanel"); // // contextMenuStrip @@ -85,15 +83,58 @@ namespace XenAdmin.TabPages this.TitleLabel.ForeColor = System.Drawing.Color.White; this.TitleLabel.Name = "TitleLabel"; // - // panel1 + // columnVirtAlloc // - resources.ApplyResources(this.panel1, "panel1"); - this.panel1.Controls.Add(this.dataGridViewSr); - this.panel1.Controls.Add(this.flowLayoutPanel1); - this.panel1.Name = "panel1"; + this.columnVirtAlloc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.columnVirtAlloc, "columnVirtAlloc"); + this.columnVirtAlloc.Name = "columnVirtAlloc"; + // + // columnSize + // + this.columnSize.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.columnSize, "columnSize"); + this.columnSize.Name = "columnSize"; + // + // columnUsage + // + this.columnUsage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.columnUsage, "columnUsage"); + this.columnUsage.Name = "columnUsage"; + // + // columnShared + // + this.columnShared.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.columnShared, "columnShared"); + this.columnShared.Name = "columnShared"; + // + // columnType + // + this.columnType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.columnType, "columnType"); + this.columnType.Name = "columnType"; + // + // columnDescription + // + this.columnDescription.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + resources.ApplyResources(this.columnDescription, "columnDescription"); + this.columnDescription.Name = "columnDescription"; + // + // columnName + // + this.columnName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + resources.ApplyResources(this.columnName, "columnName"); + this.columnName.Name = "columnName"; + // + // columnImage + // + this.columnImage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.columnImage, "columnImage"); + this.columnImage.Name = "columnImage"; + this.columnImage.Resizable = System.Windows.Forms.DataGridViewTriState.False; // // dataGridViewSr // + resources.ApplyResources(this.dataGridViewSr, "dataGridViewSr"); this.dataGridViewSr.BackgroundColor = System.Drawing.SystemColors.Window; this.dataGridViewSr.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.dataGridViewSr.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; @@ -106,67 +147,16 @@ namespace XenAdmin.TabPages this.columnUsage, this.columnSize, this.columnVirtAlloc}); - resources.ApplyResources(this.dataGridViewSr, "dataGridViewSr"); this.dataGridViewSr.MultiSelect = true; this.dataGridViewSr.Name = "dataGridViewSr"; this.dataGridViewSr.SelectionChanged += new System.EventHandler(this.dataGridViewSrs_SelectedIndexChanged); this.dataGridViewSr.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.dataGridViewSr_SortCompare); this.dataGridViewSr.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dataGridViewSr_MouseUp); // - // columnImage - // - this.columnImage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.columnImage, "columnImage"); - this.columnImage.Name = "columnImage"; - this.columnImage.Resizable = System.Windows.Forms.DataGridViewTriState.False; - // - // columnName - // - this.columnName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - resources.ApplyResources(this.columnName, "columnName"); - this.columnName.Name = "columnName"; - // - // columnDescription - // - this.columnDescription.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - resources.ApplyResources(this.columnDescription, "columnDescription"); - this.columnDescription.Name = "columnDescription"; - // - // columnType - // - this.columnType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.columnType, "columnType"); - this.columnType.Name = "columnType"; - // - // columnShared - // - this.columnShared.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.columnShared, "columnShared"); - this.columnShared.Name = "columnShared"; - // - // columnUsage - // - this.columnUsage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.columnUsage, "columnUsage"); - this.columnUsage.Name = "columnUsage"; - // - // columnSize - // - this.columnSize.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.columnSize, "columnSize"); - this.columnSize.Name = "columnSize"; - // - // columnVirtAlloc - // - this.columnVirtAlloc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.columnVirtAlloc, "columnVirtAlloc"); - this.columnVirtAlloc.Name = "columnVirtAlloc"; - // // flowLayoutPanel1 // this.flowLayoutPanel1.Controls.Add(this.newSRButton); this.flowLayoutPanel1.Controls.Add(this.trimButtonContainer); - this.flowLayoutPanel1.Controls.Add(this.groupBox1); this.flowLayoutPanel1.Controls.Add(this.buttonProperties); resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; @@ -191,12 +181,6 @@ namespace XenAdmin.TabPages this.trimButton.Name = "trimButton"; this.trimButton.UseVisualStyleBackColor = true; // - // groupBox1 - // - resources.ApplyResources(this.groupBox1, "groupBox1"); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.TabStop = false; - // // buttonProperties // resources.ApplyResources(this.buttonProperties, "buttonProperties"); @@ -204,6 +188,14 @@ namespace XenAdmin.TabPages this.buttonProperties.UseVisualStyleBackColor = true; this.buttonProperties.Click += new System.EventHandler(this.buttonProperties_Click); // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.labelNetworkheadings, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.dataGridViewSr, 0, 1); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // // PhysicalStoragePage // resources.ApplyResources(this, "$this"); @@ -213,11 +205,11 @@ namespace XenAdmin.TabPages this.Name = "PhysicalStoragePage"; this.Controls.SetChildIndex(this.pageContainerPanel, 0); this.pageContainerPanel.ResumeLayout(false); - this.pageContainerPanel.PerformLayout(); - this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewSr)).EndInit(); this.flowLayoutPanel1.ResumeLayout(false); this.trimButtonContainer.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -225,17 +217,16 @@ namespace XenAdmin.TabPages #endregion - private System.Windows.Forms.Label TitleLabel; private System.Windows.Forms.ContextMenuStrip contextMenuStrip; + private System.Windows.Forms.Label TitleLabel; private System.Windows.Forms.Label labelNetworkheadings; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button buttonProperties; - private System.Windows.Forms.GroupBox groupBox1; - private XenAdmin.Commands.CommandButton newSRButton; - private XenAdmin.Commands.CommandButton trimButton; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private Commands.CommandButton newSRButton; + private Commands.CommandButton trimButton; private Controls.ToolTipContainer trimButtonContainer; + private Controls.DataGridViewEx.DataGridViewEx dataGridViewSr; + private System.Windows.Forms.Button buttonProperties; private System.Windows.Forms.DataGridViewImageColumn columnImage; private System.Windows.Forms.DataGridViewTextBoxColumn columnName; private System.Windows.Forms.DataGridViewTextBoxColumn columnDescription; @@ -244,5 +235,6 @@ namespace XenAdmin.TabPages private System.Windows.Forms.DataGridViewTextBoxColumn columnUsage; private System.Windows.Forms.DataGridViewTextBoxColumn columnSize; private System.Windows.Forms.DataGridViewTextBoxColumn columnVirtAlloc; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; } } diff --git a/XenAdmin/TabPages/PhysicalStoragePage.resx b/XenAdmin/TabPages/PhysicalStoragePage.resx index 3522c52f3..405059373 100755 --- a/XenAdmin/TabPages/PhysicalStoragePage.resx +++ b/XenAdmin/TabPages/PhysicalStoragePage.resx @@ -117,8 +117,184 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 1 + + + True + + + + Segoe UI, 11.25pt + - + + NoControl + + + 3, 0 + + + 61, 20 + + + 0 + + + Storage + + + labelNetworkheadings + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + NoControl + + + 3, 3 + + + 102, 23 + + + 0 + + + &New SR... + + + newSRButton + + + XenAdmin.Commands.CommandButton, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + flowLayoutPanel1 + + + 0 + + + Fill + + + NoControl + + + 0, 0 + + + 0, 0, 0, 0 + + + 140, 23 + + + 0 + + + Re&claim freed space + + + trimButton + + + XenAdmin.Commands.CommandButton, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + trimButtonContainer + + + 1 + + + 111, 3 + + + 140, 23 + + + 1 + + + trimButtonContainer + + + XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + flowLayoutPanel1 + + + 1 + + + Top, Right + + + NoControl + + + 257, 3 + + + 102, 23 + + + 2 + + + P&roperties + + + buttonProperties + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flowLayoutPanel1 + + + 2 + + + Fill + + + 0, 267 + + + 0, 0, 0, 0 + + + 900, 83 + + + 2 + + + flowLayoutPanel1 + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + Top, Bottom, Left, Right @@ -127,7 +303,6 @@ - 5 @@ -209,18 +384,17 @@ 120 - - Fill - - - 0, 0 + 3, 23 + + + 3, 3, 3, 12 - 897, 259 + 894, 232 - 6 + 1 dataGridViewSr @@ -229,247 +403,46 @@ XenAdmin.Controls.DataGridViewEx.DataGridViewEx, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - panel1 + tableLayoutPanel1 - 0 + 2 - - 3, 5 - - - 3, 0, 3, 0 - - - 102, 23 - - - 1 - - - &New SR... - - - newSRButton - - - XenAdmin.Commands.CommandButton, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - flowLayoutPanel1 - - - 0 - - + Fill - - 0, 0 + + 10, 10 - - 3, 0, 3, 0 - - - 120, 23 - - - 2 - - - Re&claim freed space - - - trimButton - - - XenAdmin.Commands.CommandButton, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - trimButtonContainer - - - 1 - - - 108, 5 - - - 0, 0, 3, 0 - - - 120, 23 - - - 2 - - - trimButtonContainer - - - XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - flowLayoutPanel1 - - - 1 - - - 234, 5 - - - 3, 0, 3, 0 - - - 2, 20 - - + 3 - + + 900, 350 + + 0 - - groupBox1 + + tableLayoutPanel1 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - flowLayoutPanel1 - - - 2 - - - Top, Right - - - 242, 5 - - - 3, 0, 3, 0 - - - 102, 23 - - - 4 - - - P&roperties - - - buttonProperties - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowLayoutPanel1 - - - 3 - - - Bottom - - - 0, 259 - - - 0, 5, 0, 0 - - - 0, 5, 0, 0 - - - 897, 34 - - - 5 - - - flowLayoutPanel1 - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel1 - - - 1 - - - 10, 35 - - - 900, 400 - - - 897, 293 - - - 0 - - - panel1 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + pageContainerPanel - + 0 - - True - - - Segoe UI, 11.25pt - - - NoControl - - - 6, 10 - - - 0, 0, 0, 0 - - - 0, 0, 0, 2 - - - 61, 22 - - - 0 - - - Storage - - - labelNetworkheadings - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pageContainerPanel - - - 1 + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelNetworkheadings" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="flowLayoutPanel1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dataGridViewSr" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,Percent,75,Percent,25" /></TableLayoutSettings> 0, 78 - 920, 344 + 920, 370 0 @@ -534,6 +507,9 @@ True + + 38 + 96, 96 @@ -541,42 +517,12 @@ Segoe UI, 8.25pt - 920, 422 + 920, 448 - - columnImage + + columnVirtAlloc - - System.Windows.Forms.DataGridViewImageColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - columnName - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - columnDescription - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - columnType - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - columnShared - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - columnUsage - - + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -585,12 +531,42 @@ System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - columnVirtAlloc + + columnUsage - + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + columnShared + + + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + columnType + + + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + columnDescription + + + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + columnName + + + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + columnImage + + + System.Windows.Forms.DataGridViewImageColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + PhysicalStoragePage diff --git a/XenAdmin/TabPages/SrStoragePage.Designer.cs b/XenAdmin/TabPages/SrStoragePage.Designer.cs index d4ffef7b5..9ef3c0736 100644 --- a/XenAdmin/TabPages/SrStoragePage.Designer.cs +++ b/XenAdmin/TabPages/SrStoragePage.Designer.cs @@ -40,13 +40,13 @@ namespace XenAdmin.TabPages this.toolTipContainerMove = new XenAdmin.Controls.ToolTipContainer(); this.buttonMove = new System.Windows.Forms.Button(); this.dataGridViewVDIs = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.ColumnName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnVolume = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnDesc = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnSize = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnVM = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnCBT = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.pageContainerPanel.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.RemoveButtonContainer.SuspendLayout(); @@ -161,9 +161,9 @@ namespace XenAdmin.TabPages // this.flowLayoutPanel1.Controls.Add(this.toolTipContainerRescan); this.flowLayoutPanel1.Controls.Add(this.addVirtualDiskButton); - this.flowLayoutPanel1.Controls.Add(this.EditButtonContainer); this.flowLayoutPanel1.Controls.Add(this.toolTipContainerMove); this.flowLayoutPanel1.Controls.Add(this.RemoveButtonContainer); + this.flowLayoutPanel1.Controls.Add(this.EditButtonContainer); resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; // @@ -215,14 +215,6 @@ namespace XenAdmin.TabPages this.dataGridViewVDIs.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dataGridViewVDIs_KeyUp); this.dataGridViewVDIs.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dataGridViewVDIs_MouseUp); // - // tableLayoutPanel1 - // - resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); - this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.dataGridViewVDIs, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - // // ColumnName // this.ColumnName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; @@ -265,6 +257,14 @@ namespace XenAdmin.TabPages this.ColumnCBT.Name = "ColumnCBT"; this.ColumnCBT.ReadOnly = true; // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.dataGridViewVDIs, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // // SrStoragePage // resources.ApplyResources(this, "$this"); diff --git a/XenAdmin/TabPages/SrStoragePage.resx b/XenAdmin/TabPages/SrStoragePage.resx index d0ab651fd..b598ee3bd 100644 --- a/XenAdmin/TabPages/SrStoragePage.resx +++ b/XenAdmin/TabPages/SrStoragePage.resx @@ -201,6 +201,108 @@ 1 + + Fill + + + 0, 0 + + + 0, 0, 0, 0 + + + 102, 23 + + + 0 + + + Mov&e... + + + buttonMove + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolTipContainerMove + + + 1 + + + 219, 3 + + + 102, 23 + + + 2 + + + toolTipContainerMove + + + XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + flowLayoutPanel1 + + + 2 + + + Fill + + + NoControl + + + 0, 0 + + + 102, 23 + + + 0 + + + &Delete + + + RemoveButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + RemoveButtonContainer + + + 1 + + + 327, 3 + + + 102, 23 + + + 3 + + + RemoveButtonContainer + + + XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + flowLayoutPanel1 + + + 3 + Top, Right @@ -238,13 +340,13 @@ 1 - 219, 3 + 435, 3 102, 23 - 2 + 4 EditButtonContainer @@ -256,118 +358,19 @@ flowLayoutPanel1 - 2 - - - Fill - - - 0, 0 - - - 0, 0, 0, 0 - - - 102, 23 - - - 0 - - - Mov&e... - - - buttonMove - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolTipContainerMove - - - 1 - - - 327, 3 - - - 102, 23 - - - 3 - - - toolTipContainerMove - - - XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - flowLayoutPanel1 - - - 3 - - - Fill - - - NoControl - - - 0, 0 - - - 102, 23 - - - 0 - - - &Delete - - - RemoveButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - RemoveButtonContainer - - - 1 - - - 435, 3 - - - 102, 23 - - - 4 - - - RemoveButtonContainer - - - XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - flowLayoutPanel1 - - 4 Fill - 3, 272 + 0, 269 + + + 0, 0, 0, 0 - 894, 77 + 900, 83 2 @@ -435,6 +438,9 @@ Changed Block Tracking + + 155 + Fill diff --git a/XenAdmin/TabPages/VMStoragePage.Designer.cs b/XenAdmin/TabPages/VMStoragePage.Designer.cs index c8841c4f0..90a89ef25 100644 --- a/XenAdmin/TabPages/VMStoragePage.Designer.cs +++ b/XenAdmin/TabPages/VMStoragePage.Designer.cs @@ -41,10 +41,10 @@ namespace XenAdmin.TabPages this.DeactivateButton = new System.Windows.Forms.Button(); this.MoveButtonContainer = new XenAdmin.Controls.ToolTipContainer(); this.MoveButton = new System.Windows.Forms.Button(); - this.DeleteButtonContainer = new XenAdmin.Controls.ToolTipContainer(); - this.DeleteButton = new System.Windows.Forms.Button(); this.DetachButtonContainer = new XenAdmin.Controls.ToolTipContainer(); this.DetachButton = new System.Windows.Forms.Button(); + this.DeleteButtonContainer = new XenAdmin.Controls.ToolTipContainer(); + this.DeleteButton = new System.Windows.Forms.Button(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolStripMenuItemAdd = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemAttach = new System.Windows.Forms.ToolStripMenuItem(); @@ -56,6 +56,16 @@ namespace XenAdmin.TabPages this.toolStripMenuItemProperties = new System.Windows.Forms.ToolStripMenuItem(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.dataGridViewStorage = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); + this.ColumnDevicePosition = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnDesc = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnSR = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnSRVolume = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnSize = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnReadOnly = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnPriority = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnActive = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnDevicePath = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.multipleDvdIsoList1 = new XenAdmin.Controls.MultipleDvdIsoList(); this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -67,22 +77,12 @@ namespace XenAdmin.TabPages this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnDevicePosition = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnDesc = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnSR = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnSRVolume = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnSize = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnReadOnly = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnPriority = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnActive = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnDevicePath = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.pageContainerPanel.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); this.DeactivateButtonContainer.SuspendLayout(); this.MoveButtonContainer.SuspendLayout(); - this.DeleteButtonContainer.SuspendLayout(); this.DetachButtonContainer.SuspendLayout(); + this.DeleteButtonContainer.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewStorage)).BeginInit(); @@ -120,9 +120,9 @@ namespace XenAdmin.TabPages this.flowLayoutPanel1.Controls.Add(this.AttachButton); this.flowLayoutPanel1.Controls.Add(this.DeactivateButtonContainer); this.flowLayoutPanel1.Controls.Add(this.MoveButtonContainer); - this.flowLayoutPanel1.Controls.Add(this.EditButton); - this.flowLayoutPanel1.Controls.Add(this.DeleteButtonContainer); this.flowLayoutPanel1.Controls.Add(this.DetachButtonContainer); + this.flowLayoutPanel1.Controls.Add(this.DeleteButtonContainer); + this.flowLayoutPanel1.Controls.Add(this.EditButton); resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; // @@ -152,19 +152,6 @@ namespace XenAdmin.TabPages this.MoveButton.UseVisualStyleBackColor = true; this.MoveButton.Click += new System.EventHandler(this.MoveButton_Click); // - // DeleteButtonContainer - // - this.DeleteButtonContainer.Controls.Add(this.DeleteButton); - resources.ApplyResources(this.DeleteButtonContainer, "DeleteButtonContainer"); - this.DeleteButtonContainer.Name = "DeleteButtonContainer"; - // - // DeleteButton - // - resources.ApplyResources(this.DeleteButton, "DeleteButton"); - this.DeleteButton.Name = "DeleteButton"; - this.DeleteButton.UseVisualStyleBackColor = true; - this.DeleteButton.Click += new System.EventHandler(this.DeleteDriveButton_Click); - // // DetachButtonContainer // this.DetachButtonContainer.Controls.Add(this.DetachButton); @@ -178,6 +165,19 @@ namespace XenAdmin.TabPages this.DetachButton.UseVisualStyleBackColor = true; this.DetachButton.Click += new System.EventHandler(this.DetachButton_Click); // + // DeleteButtonContainer + // + this.DeleteButtonContainer.Controls.Add(this.DeleteButton); + resources.ApplyResources(this.DeleteButtonContainer, "DeleteButtonContainer"); + this.DeleteButtonContainer.Name = "DeleteButtonContainer"; + // + // DeleteButton + // + resources.ApplyResources(this.DeleteButton, "DeleteButton"); + this.DeleteButton.Name = "DeleteButton"; + this.DeleteButton.UseVisualStyleBackColor = true; + this.DeleteButton.Click += new System.EventHandler(this.DeleteDriveButton_Click); + // // contextMenuStrip1 // this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); @@ -276,6 +276,76 @@ namespace XenAdmin.TabPages this.dataGridViewStorage.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dataGridViewStorage_KeyUp); this.dataGridViewStorage.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dataGridViewStorage_MouseUp); // + // ColumnDevicePosition + // + this.ColumnDevicePosition.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.ColumnDevicePosition, "ColumnDevicePosition"); + this.ColumnDevicePosition.Name = "ColumnDevicePosition"; + this.ColumnDevicePosition.ReadOnly = true; + // + // ColumnName + // + this.ColumnName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + resources.ApplyResources(this.ColumnName, "ColumnName"); + this.ColumnName.Name = "ColumnName"; + this.ColumnName.ReadOnly = true; + // + // ColumnDesc + // + this.ColumnDesc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + resources.ApplyResources(this.ColumnDesc, "ColumnDesc"); + this.ColumnDesc.Name = "ColumnDesc"; + this.ColumnDesc.ReadOnly = true; + // + // ColumnSR + // + this.ColumnSR.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + resources.ApplyResources(this.ColumnSR, "ColumnSR"); + this.ColumnSR.Name = "ColumnSR"; + this.ColumnSR.ReadOnly = true; + // + // ColumnSRVolume + // + this.ColumnSRVolume.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + resources.ApplyResources(this.ColumnSRVolume, "ColumnSRVolume"); + this.ColumnSRVolume.Name = "ColumnSRVolume"; + this.ColumnSRVolume.ReadOnly = true; + // + // ColumnSize + // + this.ColumnSize.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.ColumnSize, "ColumnSize"); + this.ColumnSize.Name = "ColumnSize"; + this.ColumnSize.ReadOnly = true; + // + // ColumnReadOnly + // + this.ColumnReadOnly.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.ColumnReadOnly, "ColumnReadOnly"); + this.ColumnReadOnly.Name = "ColumnReadOnly"; + this.ColumnReadOnly.ReadOnly = true; + // + // ColumnPriority + // + this.ColumnPriority.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.ColumnPriority, "ColumnPriority"); + this.ColumnPriority.Name = "ColumnPriority"; + this.ColumnPriority.ReadOnly = true; + // + // ColumnActive + // + this.ColumnActive.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.ColumnActive, "ColumnActive"); + this.ColumnActive.Name = "ColumnActive"; + this.ColumnActive.ReadOnly = true; + // + // ColumnDevicePath + // + this.ColumnDevicePath.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + resources.ApplyResources(this.ColumnDevicePath, "ColumnDevicePath"); + this.ColumnDevicePath.Name = "ColumnDevicePath"; + this.ColumnDevicePath.ReadOnly = true; + // // multipleDvdIsoList1 // resources.ApplyResources(this.multipleDvdIsoList1, "multipleDvdIsoList1"); @@ -355,76 +425,6 @@ namespace XenAdmin.TabPages this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10"; this.dataGridViewTextBoxColumn10.ReadOnly = true; // - // ColumnDevicePosition - // - this.ColumnDevicePosition.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.ColumnDevicePosition, "ColumnDevicePosition"); - this.ColumnDevicePosition.Name = "ColumnDevicePosition"; - this.ColumnDevicePosition.ReadOnly = true; - // - // ColumnName - // - this.ColumnName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; - resources.ApplyResources(this.ColumnName, "ColumnName"); - this.ColumnName.Name = "ColumnName"; - this.ColumnName.ReadOnly = true; - // - // ColumnDesc - // - this.ColumnDesc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - resources.ApplyResources(this.ColumnDesc, "ColumnDesc"); - this.ColumnDesc.Name = "ColumnDesc"; - this.ColumnDesc.ReadOnly = true; - // - // ColumnSR - // - this.ColumnSR.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; - resources.ApplyResources(this.ColumnSR, "ColumnSR"); - this.ColumnSR.Name = "ColumnSR"; - this.ColumnSR.ReadOnly = true; - // - // ColumnSRVolume - // - this.ColumnSRVolume.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; - resources.ApplyResources(this.ColumnSRVolume, "ColumnSRVolume"); - this.ColumnSRVolume.Name = "ColumnSRVolume"; - this.ColumnSRVolume.ReadOnly = true; - // - // ColumnSize - // - this.ColumnSize.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.ColumnSize, "ColumnSize"); - this.ColumnSize.Name = "ColumnSize"; - this.ColumnSize.ReadOnly = true; - // - // ColumnReadOnly - // - this.ColumnReadOnly.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.ColumnReadOnly, "ColumnReadOnly"); - this.ColumnReadOnly.Name = "ColumnReadOnly"; - this.ColumnReadOnly.ReadOnly = true; - // - // ColumnPriority - // - this.ColumnPriority.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.ColumnPriority, "ColumnPriority"); - this.ColumnPriority.Name = "ColumnPriority"; - this.ColumnPriority.ReadOnly = true; - // - // ColumnActive - // - this.ColumnActive.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.ColumnActive, "ColumnActive"); - this.ColumnActive.Name = "ColumnActive"; - this.ColumnActive.ReadOnly = true; - // - // ColumnDevicePath - // - this.ColumnDevicePath.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - resources.ApplyResources(this.ColumnDevicePath, "ColumnDevicePath"); - this.ColumnDevicePath.Name = "ColumnDevicePath"; - this.ColumnDevicePath.ReadOnly = true; - // // VMStoragePage // resources.ApplyResources(this, "$this"); @@ -437,8 +437,8 @@ namespace XenAdmin.TabPages this.flowLayoutPanel1.ResumeLayout(false); this.DeactivateButtonContainer.ResumeLayout(false); this.MoveButtonContainer.ResumeLayout(false); - this.DeleteButtonContainer.ResumeLayout(false); this.DetachButtonContainer.ResumeLayout(false); + this.DeleteButtonContainer.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewStorage)).EndInit(); diff --git a/XenAdmin/TabPages/VMStoragePage.cs b/XenAdmin/TabPages/VMStoragePage.cs index 001f5e8f4..ddc8585bc 100644 --- a/XenAdmin/TabPages/VMStoragePage.cs +++ b/XenAdmin/TabPages/VMStoragePage.cs @@ -365,7 +365,7 @@ namespace XenAdmin.TabPages } // Move button - Command moveCmd = MoveVirtualDiskDialog.MoveMigrateCommand(Program.MainWindow, selectedVDIs); + Command moveCmd = MoveVirtualDiskDialog.MoveMigrateCommand(Program.MainWindow, new SelectedItemCollection(selectedVDIs)); if (moveCmd.CanExecute()) { MoveButton.Enabled = true; @@ -404,11 +404,10 @@ namespace XenAdmin.TabPages List rows = SelectedVBDRows; if (rows == null) return; - List l = new List(); - foreach (VBDRow r in rows) - l.Add(new SelectedItem(r.VDI)); - Command cmd = MoveVirtualDiskDialog.MoveMigrateCommand(Program.MainWindow, l); + var vdis = (from VBDRow r in rows select new SelectedItem(r.VDI)).ToList(); + + var cmd = MoveVirtualDiskDialog.MoveMigrateCommand(Program.MainWindow, new SelectedItemCollection(vdis)); if (cmd.CanExecute()) cmd.Execute(); } diff --git a/XenAdmin/TabPages/VMStoragePage.resx b/XenAdmin/TabPages/VMStoragePage.resx index 8d2ebc5e1..6517cac49 100644 --- a/XenAdmin/TabPages/VMStoragePage.resx +++ b/XenAdmin/TabPages/VMStoragePage.resx @@ -127,10 +127,7 @@ - 2, 2 - - - 2, 2, 2, 2 + 3, 3 96, 23 @@ -157,10 +154,7 @@ NoControl - 102, 2 - - - 2, 2, 2, 2 + 105, 3 96, 23 @@ -217,10 +211,7 @@ 1 - 202, 2 - - - 2, 2, 2, 2 + 207, 3 96, 23 @@ -274,10 +265,7 @@ 1 - 302, 2 - - - 2, 2, 2, 2 + 309, 3 96, 23 @@ -297,37 +285,58 @@ 3 - - False + + Fill - + NoControl - - 402, 2 + + 0, 0 - - 2, 2, 2, 2 + + 0, 0, 0, 0 - + 96, 23 - - 4 + + 0 - - P&roperties + + D&etach - - EditButton + + DetachButton - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + DetachButtonContainer + + + 1 + + + 411, 3 + + + 96, 23 + + + 4 + + + DetachButtonContainer + + + XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + flowLayoutPanel1 - + 4 @@ -364,10 +373,7 @@ 1 - 502, 2 - - - 2, 2, 2, 2 + 513, 3 96, 23 @@ -387,74 +393,47 @@ 5 - - Fill + + False - + NoControl - - 0, 0 + + 615, 3 - - 0, 0, 0, 0 - - + 96, 23 - - 0 - - - D&etach - - - DetachButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - DetachButtonContainer - - - 1 - - - 602, 2 - - - 2, 2, 2, 2 - - - 96, 23 - - + 6 - - DetachButtonContainer + + P&roperties - - XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + EditButton - + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + flowLayoutPanel1 - + 6 Fill - 2, 252 + 0, 250 - 2, 2, 2, 2 + 0, 0, 0, 0 - 796, 64 + 800, 68 2 @@ -567,20 +546,23 @@ Device Path + + 91 + Fill - 2, 50 + 3, 51 - 2, 2, 2, 10 + 3, 3, 3, 12 900, 0 - 796, 190 + 794, 187 1 @@ -640,7 +622,7 @@ 800, 318 - 1 + 0 tableLayoutPanel1 @@ -663,6 +645,9 @@ 820, 338 + + 0 + pageContainerPanel diff --git a/XenAdminTests/DialogTests/MoveVirtualDiskDialogTests.cs b/XenAdminTests/DialogTests/MoveVirtualDiskDialogTests.cs index 8e8b9ecfe..d5ae163d8 100644 --- a/XenAdminTests/DialogTests/MoveVirtualDiskDialogTests.cs +++ b/XenAdminTests/DialogTests/MoveVirtualDiskDialogTests.cs @@ -44,7 +44,7 @@ namespace XenAdminTests.DialogTests.boston.MoveVirtualDiskDialogTests protected override MoveVirtualDiskDialog NewDialog() { var vdi = GetAnyVDI(); - return new MoveVirtualDiskDialog(vdi.Connection, new List {vdi}, null); + return new MoveVirtualDiskDialog(vdi.Connection, new List {vdi}); } protected override void RunAfter() diff --git a/XenModel/Actions/VDI/MoveVirtualDiskAction.cs b/XenModel/Actions/VDI/MoveVirtualDiskAction.cs index fe90c2187..161167b2f 100644 --- a/XenModel/Actions/VDI/MoveVirtualDiskAction.cs +++ b/XenModel/Actions/VDI/MoveVirtualDiskAction.cs @@ -44,7 +44,7 @@ namespace XenAdmin.Actions { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private XenAPI.VDI vdi; + private VDI vdi; public MoveVirtualDiskAction(IXenConnection connection, XenAPI.VDI vdi, SR sr) : base(connection, string.Format(Messages.ACTION_MOVING_VDI_TITLE, Helpers.GetName(vdi), Helpers.GetName(sr))) @@ -66,25 +66,65 @@ namespace XenAdmin.Actions Description = string.Format(Messages.ACTION_MOVING_VDI_STATUS, Helpers.GetName(vdi)); PercentComplete = 10; log.DebugFormat("Moving VDI '{0}'", Helpers.GetName(vdi)); - RelatedTask = XenAPI.VDI.async_copy(Session, vdi.opaque_ref, SR.opaque_ref); + RelatedTask = VDI.async_copy(Session, vdi.opaque_ref, SR.opaque_ref); PollToCompletion(PercentComplete, 60); - XenAPI.VDI newVDI = Connection.WaitForCache(new XenRef(Result)); + + VDI newVdi = Connection.WaitForCache(new XenRef(Result)); // if the original is a suspend VDI, link the suspended VM to the new VDI if (vdi.type == vdi_type.suspend) { var suspendedVm = (from vm in Connection.Cache.VMs - let suspendVdi = Connection.Resolve(vm.suspend_VDI) + let suspendVdi = Connection.Resolve(vm.suspend_VDI) where suspendVdi != null && suspendVdi.uuid == vdi.uuid select vm).FirstOrDefault(); if (suspendedVm != null) { - XenAPI.VM.set_suspend_VDI(Session, suspendedVm.opaque_ref, newVDI.opaque_ref); + VM.set_suspend_VDI(Session, suspendedVm.opaque_ref, newVdi.opaque_ref); } } - PercentComplete = 70; + PercentComplete = 60; + + var newVbds = new List(); + foreach (var vbdRef in vdi.VBDs) + { + var oldVbd = Connection.Resolve(vbdRef); + if (oldVbd == null) + continue; + + var newVbd = new VBD + { + userdevice = oldVbd.userdevice, + bootable = oldVbd.bootable, + mode = oldVbd.mode, + type = oldVbd.type, + unpluggable = oldVbd.unpluggable, + other_config = oldVbd.other_config, + VDI = new XenRef(newVdi.opaque_ref), + VM = new XenRef(oldVbd.VM) + }; + newVbd.SetIsOwner(oldVbd.GetIsOwner()); + newVbds.Add(newVbd); + + try + { + if (oldVbd.currently_attached && oldVbd.allowed_operations.Contains(vbd_operations.unplug)) + VBD.unplug(Session, vbdRef); + } + finally + { + if (!oldVbd.currently_attached) + VBD.destroy(Session, vbdRef); + } + } + + PercentComplete = 80; + + VDI.destroy(Session, vdi.opaque_ref); + + foreach (var newVbd in newVbds) + Connection.WaitForCache(VBD.create(Session, newVbd)); - XenAPI.VDI.destroy(Session, vdi.opaque_ref); PercentComplete = 100; Description = Messages.COMPLETED; log.DebugFormat("Moved VDI '{0}'", Helpers.GetName(vdi)); diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 2009808b1..320d66df8 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -6793,15 +6793,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to You must detach this virtual disk before it can be moved.. - /// - public static string CANNOT_MOVE_VDI_WITH_VBDS { - get { - return ResourceManager.GetString("CANNOT_MOVE_VDI_WITH_VBDS", resourceCulture); - } - } - /// /// Looks up a localized string similar to Cannot parse required parameter '{1}' on XML node '{0}'. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index a28f15e17..ea6c0fc33 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -2464,9 +2464,6 @@ Deleting this bond will disrupt traffic through the secondary interface on the b Snapshot disks cannot be moved - - You must detach this virtual disk before it can be moved. - Cannot parse required parameter '{1}' on XML node '{0}' diff --git a/XenOvfTransport/Import.cs b/XenOvfTransport/Import.cs index 7d108ebfb..374dfd15b 100644 --- a/XenOvfTransport/Import.cs +++ b/XenOvfTransport/Import.cs @@ -553,7 +553,6 @@ namespace XenOvfTransport string sourcefile = filename; string encryptfilename = null; string uncompressedfilename = null; - string destinationPath = Properties.Settings.Default.xenISOMount; string StartPath = Directory.GetCurrentDirectory(); Directory.SetCurrentDirectory(pathToOvf); Stream dataStream = null; @@ -701,8 +700,7 @@ namespace XenOvfTransport try { #region SEE IF TARGET SR HAS ENOUGH SPACE - if (useTransport == TransferType.UploadRawVDI || - useTransport == TransferType.iSCSI) + if (useTransport == TransferType.UploadRawVDI || useTransport == TransferType.iSCSI) { long freespace; string contenttype = string.Empty; @@ -785,11 +783,24 @@ namespace XenOvfTransport { wimDisk = null; } - if (File.Exists(encryptfilename)) { File.Delete(encryptfilename); } - if (File.Exists(uncompressedfilename)) { File.Delete(uncompressedfilename); } + + try + { + if (File.Exists(encryptfilename)) + File.Delete(encryptfilename); + + if (File.Exists(uncompressedfilename)) + File.Delete(uncompressedfilename); + } + catch + { + //ignore errors + } + + Directory.SetCurrentDirectory(StartPath); } - Directory.SetCurrentDirectory(StartPath); + log.DebugFormat("OVF.Import.ImportFile leave: created {0} VDIs", vdiRef.Count); return vdiRef; }