diff --git a/XenAdmin/Dialogs/IscsiChoicesDialog.Designer.cs b/XenAdmin/Dialogs/IscsiChoicesDialog.Designer.cs
deleted file mode 100644
index 96b27125c..000000000
--- a/XenAdmin/Dialogs/IscsiChoicesDialog.Designer.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-namespace XenAdmin.Dialogs
-{
- partial class IscsiChoicesDialog
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(IscsiChoicesDialog));
- this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
- this.pictureBoxIcon = new System.Windows.Forms.PictureBox();
- this.flowLayoutPanelButtons = new System.Windows.Forms.FlowLayoutPanel();
- this.buttonCancel = new System.Windows.Forms.Button();
- this.buttonFormat = new System.Windows.Forms.Button();
- this.buttonReattach = new System.Windows.Forms.Button();
- this.labelMessage = new System.Windows.Forms.Label();
- this.labelSRinfo = new System.Windows.Forms.Label();
- this.tableLayoutPanel1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBoxIcon)).BeginInit();
- this.flowLayoutPanelButtons.SuspendLayout();
- this.SuspendLayout();
- //
- // tableLayoutPanel1
- //
- resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
- this.tableLayoutPanel1.Controls.Add(this.pictureBoxIcon, 0, 0);
- this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanelButtons, 1, 2);
- this.tableLayoutPanel1.Controls.Add(this.labelMessage, 1, 0);
- this.tableLayoutPanel1.Controls.Add(this.labelSRinfo, 1, 1);
- this.tableLayoutPanel1.Name = "tableLayoutPanel1";
- //
- // pictureBoxIcon
- //
- resources.ApplyResources(this.pictureBoxIcon, "pictureBoxIcon");
- this.pictureBoxIcon.Name = "pictureBoxIcon";
- this.pictureBoxIcon.TabStop = false;
- //
- // flowLayoutPanelButtons
- //
- resources.ApplyResources(this.flowLayoutPanelButtons, "flowLayoutPanelButtons");
- this.flowLayoutPanelButtons.Controls.Add(this.buttonCancel);
- this.flowLayoutPanelButtons.Controls.Add(this.buttonFormat);
- this.flowLayoutPanelButtons.Controls.Add(this.buttonReattach);
- this.flowLayoutPanelButtons.Name = "flowLayoutPanelButtons";
- //
- // buttonCancel
- //
- resources.ApplyResources(this.buttonCancel, "buttonCancel");
- this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.UseVisualStyleBackColor = true;
- //
- // buttonFormat
- //
- resources.ApplyResources(this.buttonFormat, "buttonFormat");
- this.buttonFormat.DialogResult = System.Windows.Forms.DialogResult.No;
- this.buttonFormat.Name = "buttonFormat";
- this.buttonFormat.UseVisualStyleBackColor = true;
- //
- // buttonReattach
- //
- resources.ApplyResources(this.buttonReattach, "buttonReattach");
- this.buttonReattach.DialogResult = System.Windows.Forms.DialogResult.Yes;
- this.buttonReattach.Name = "buttonReattach";
- this.buttonReattach.UseVisualStyleBackColor = true;
- //
- // labelMessage
- //
- resources.ApplyResources(this.labelMessage, "labelMessage");
- this.labelMessage.Name = "labelMessage";
- //
- // labelSRinfo
- //
- resources.ApplyResources(this.labelSRinfo, "labelSRinfo");
- this.labelSRinfo.Name = "labelSRinfo";
- //
- // IscsiChoicesDialog
- //
- resources.ApplyResources(this, "$this");
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
- this.CancelButton = this.buttonCancel;
- this.Controls.Add(this.tableLayoutPanel1);
- this.Name = "IscsiChoicesDialog";
- this.ShowIcon = false;
- this.tableLayoutPanel1.ResumeLayout(false);
- this.tableLayoutPanel1.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBoxIcon)).EndInit();
- this.flowLayoutPanelButtons.ResumeLayout(false);
- this.flowLayoutPanelButtons.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
- private System.Windows.Forms.Button buttonReattach;
- private System.Windows.Forms.Button buttonCancel;
- private System.Windows.Forms.PictureBox pictureBoxIcon;
- private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelButtons;
- private System.Windows.Forms.Label labelMessage;
- private System.Windows.Forms.Button buttonFormat;
- private System.Windows.Forms.Label labelSRinfo;
- }
-}
\ No newline at end of file
diff --git a/XenAdmin/Dialogs/IscsiChoicesDialog.cs b/XenAdmin/Dialogs/IscsiChoicesDialog.cs
deleted file mode 100644
index 9c2ea2bc6..000000000
--- a/XenAdmin/Dialogs/IscsiChoicesDialog.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright (c) Citrix Systems, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * * Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the
- * following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the
- * following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-using System;
-using XenAdmin.Actions;
-using XenAdmin.Network;
-using XenAPI;
-
-
-namespace XenAdmin.Dialogs
-{
- ///
- /// When an existing SR is found on an iSCSI LUN, asks the user if they want
- /// to attach the SR, wipe the LUN and create a new SR, or do nothing (cancel).
- ///
- /// DialogResult.Yes - Reattach
- /// DialogResult.No - Format
- /// DialogResult.Cancel - Cancel
- ///
- public partial class IscsiChoicesDialog : XenDialogBase
- {
- public IscsiChoicesDialog(IXenConnection connection, SR.SRInfo srInfo, SR.SRTypes existingSrType, SR.SRTypes requestedSrType)
- : base(connection)
- {
- InitializeComponent();
-
- this.labelSRinfo.Text = String.Format(Messages.ISCSI_DIALOG_SR_DETAILS,
- Util.DiskSizeString(srInfo.Size), srInfo.UUID);
-
- this.labelMessage.Text = String.Format(Messages.EXISTING_SR_FOUND_ON_LUN, SR.getFriendlyTypeName(existingSrType),
- SR.getFriendlyTypeName(requestedSrType));
- }
-
- public IscsiChoicesDialog(IXenConnection connection, FibreChannelDevice dev)
- : base(connection)
- {
- InitializeComponent();
-
- this.labelSRinfo.Text = String.Format(Messages.ISCSI_DIALOG_SR_DETAILS_FOR_FIBRECHANNEL,
- dev.Vendor, dev.Serial, string.IsNullOrEmpty(dev.SCSIid) ? dev.Path : dev.SCSIid, Util.DiskSizeString(dev.Size));
- }
- }
-}
diff --git a/XenAdmin/Dialogs/IscsiChoicesDialog.ja.resx b/XenAdmin/Dialogs/IscsiChoicesDialog.ja.resx
deleted file mode 100644
index 7fb03035f..000000000
--- a/XenAdmin/Dialogs/IscsiChoicesDialog.ja.resx
+++ /dev/null
@@ -1,498 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
- Top, Bottom, Left, Right
-
-
-
- True
-
-
- GrowAndShrink
-
-
- 2
-
-
- Top
-
-
-
- Segoe UI, 9pt
-
-
-
- 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
- WdXfrwAAAABJRU5ErkJggg==
-
-
-
- 3, 3
-
-
- 32, 32
-
-
- AutoSize
-
-
- 3
-
-
- pictureBoxIcon
-
-
- System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 0
-
-
- Bottom, Right
-
-
- True
-
-
- GrowAndShrink
-
-
- Bottom, Right
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- NoControl
-
-
- 183, 3
-
-
- 3, 3, 0, 3
-
-
- 76, 28
-
-
- 2
-
-
- キャンセル
-
-
- buttonCancel
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanelButtons
-
-
- 0
-
-
- Bottom, Right
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- NoControl
-
-
- 78, 3
-
-
- 3, 3, 0, 3
-
-
- 102, 28
-
-
- 1
-
-
- フォーマット(&F)
-
-
- buttonFormat
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanelButtons
-
-
- 1
-
-
- Bottom, Right
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- NoControl
-
-
- 3, 3
-
-
- 3, 3, 0, 3
-
-
- 72, 28
-
-
- 0
-
-
- 再接続(&R)
-
-
- buttonReattach
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanelButtons
-
-
- 2
-
-
- RightToLeft
-
-
- Segoe UI, 9pt
-
-
- 131, 149
-
-
- 259, 34
-
-
- 4
-
-
- False
-
-
- flowLayoutPanelButtons
-
-
- System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 1
-
-
- True
-
-
- Fill
-
-
- Segoe UI, 9pt
-
-
- 42, 5
-
-
- 4, 5, 4, 5
-
-
- 347, 95
-
-
- 5
-
-
- 選択した LUN に既存の SR があります。この既存の SR を使用するには [再接続] をクリックします。[フォーマット] をクリックすると、このディスク上のすべてのデータが消去され、新しい SR が作成されます。
-
-警告: データの損失を防ぐため、[XenCenter] に接続していないサーバーを含め、ほかのシステムがこの LUN を使用していないことを確認してください。
-
-
- labelMessage
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 2
-
-
- Left
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- 43, 110
-
-
- 5, 5, 5, 5
-
-
- 115, 31
-
-
- 7
-
-
- SR サイズ: 5.0 GB
-SR UUID: abc-123-456
-
-
- labelSRinfo
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 3
-
-
- Segoe UI, 9pt
-
-
- 9, 10
-
-
- 0, 0, 0, 0
-
-
- 3
-
-
- 393, 186
-
-
- 0
-
-
- tableLayoutPanel1
-
-
- System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 0
-
-
- <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="pictureBoxIcon" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="flowLayoutPanelButtons" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelMessage" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelSRinfo" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings>
-
-
- True
-
-
- 96, 96
-
-
- True
-
-
- 411, 205
-
-
- Tahoma, 8pt
-
-
- 0, 0, 0, 0
-
-
- 9, 10, 9, 10
-
-
- CenterParent
-
-
- 新規ストレージ リポジトリ
-
-
- IscsiChoicesDialog
-
-
- XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
-
-
diff --git a/XenAdmin/Dialogs/IscsiChoicesDialog.resx b/XenAdmin/Dialogs/IscsiChoicesDialog.resx
deleted file mode 100644
index d32a7b3d6..000000000
--- a/XenAdmin/Dialogs/IscsiChoicesDialog.resx
+++ /dev/null
@@ -1,498 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
- Top, Bottom, Left, Right
-
-
-
- True
-
-
- GrowAndShrink
-
-
- 2
-
-
- Top
-
-
-
- Segoe UI, 9pt
-
-
-
- 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
- WdXfrwAAAABJRU5ErkJggg==
-
-
-
- 3, 3
-
-
- 32, 32
-
-
- AutoSize
-
-
- 3
-
-
- pictureBoxIcon
-
-
- System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 0
-
-
- Bottom, Right
-
-
- True
-
-
- GrowAndShrink
-
-
- Bottom, Right
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- NoControl
-
-
- 153, 3
-
-
- 3, 3, 0, 3
-
-
- 72, 25
-
-
- 2
-
-
- Cancel
-
-
- buttonCancel
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanelButtons
-
-
- 0
-
-
- Bottom, Right
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- NoControl
-
-
- 78, 3
-
-
- 3, 3, 0, 3
-
-
- 72, 25
-
-
- 1
-
-
- &Format
-
-
- buttonFormat
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanelButtons
-
-
- 1
-
-
- Bottom, Right
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- NoControl
-
-
- 3, 3
-
-
- 3, 3, 0, 3
-
-
- 72, 25
-
-
- 0
-
-
- &Reattach
-
-
- buttonReattach
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanelButtons
-
-
- 2
-
-
- RightToLeft
-
-
- Segoe UI, 9pt
-
-
- 165, 158
-
-
- 225, 31
-
-
- 4
-
-
- False
-
-
- flowLayoutPanelButtons
-
-
- System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 1
-
-
- True
-
-
- Fill
-
-
- Segoe UI, 9pt
-
-
- 42, 5
-
-
- 4, 5, 4, 5
-
-
- 347, 105
-
-
- 5
-
-
- An existing SR was found on the selected LUN. Click Reattach to use the existing SR, or click Format to destroy any data present on the disk and create a new SR.
-
-Warning: to prevent data loss you must ensure that the LUN is not in use by any other system, including servers that are not connected to [XenCenter].
-
-
- labelMessage
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 2
-
-
- Left
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- 43, 120
-
-
- 5, 5, 5, 5
-
-
- 121, 30
-
-
- 7
-
-
- SR size: 5.0 GB
-SR UUID: abc-123-456
-
-
- labelSRinfo
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 3
-
-
- Segoe UI, 9pt
-
-
- 9, 10
-
-
- 0, 0, 0, 0
-
-
- 3
-
-
- 393, 192
-
-
- 0
-
-
- tableLayoutPanel1
-
-
- System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 0
-
-
- <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="pictureBoxIcon" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="flowLayoutPanelButtons" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelMessage" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelSRinfo" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings>
-
-
- True
-
-
- 96, 96
-
-
- True
-
-
- 411, 210
-
-
- Tahoma, 8pt
-
-
- 0, 0, 0, 0
-
-
- 9, 10, 9, 10
-
-
- CenterParent
-
-
- New Storage Repository
-
-
- IscsiChoicesDialog
-
-
- XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
-
-
diff --git a/XenAdmin/Dialogs/IscsiChoicesDialog.zh-CN.resx b/XenAdmin/Dialogs/IscsiChoicesDialog.zh-CN.resx
deleted file mode 100644
index 2b71ca51f..000000000
--- a/XenAdmin/Dialogs/IscsiChoicesDialog.zh-CN.resx
+++ /dev/null
@@ -1,498 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
- Top, Bottom, Left, Right
-
-
-
- True
-
-
- GrowAndShrink
-
-
- 2
-
-
- Top
-
-
-
- Segoe UI, 9pt
-
-
-
- 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
- WdXfrwAAAABJRU5ErkJggg==
-
-
-
- 3, 3
-
-
- 32, 32
-
-
- AutoSize
-
-
- 3
-
-
- pictureBoxIcon
-
-
- System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 0
-
-
- Bottom, Right
-
-
- True
-
-
- GrowAndShrink
-
-
- Bottom, Right
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- NoControl
-
-
- 183, 3
-
-
- 3, 3, 0, 3
-
-
- 76, 28
-
-
- 2
-
-
- 取消
-
-
- buttonCancel
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanelButtons
-
-
- 0
-
-
- Bottom, Right
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- NoControl
-
-
- 78, 3
-
-
- 3, 3, 0, 3
-
-
- 102, 28
-
-
- 1
-
-
- 格式化(&F)
-
-
- buttonFormat
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanelButtons
-
-
- 1
-
-
- Bottom, Right
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- NoControl
-
-
- 3, 3
-
-
- 3, 3, 0, 3
-
-
- 72, 28
-
-
- 0
-
-
- 重新连接(&R)
-
-
- buttonReattach
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanelButtons
-
-
- 2
-
-
- RightToLeft
-
-
- Segoe UI, 9pt
-
-
- 131, 149
-
-
- 259, 34
-
-
- 4
-
-
- False
-
-
- flowLayoutPanelButtons
-
-
- System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 1
-
-
- True
-
-
- Fill
-
-
- Segoe UI, 9pt
-
-
- 42, 5
-
-
- 4, 5, 4, 5
-
-
- 347, 95
-
-
- 5
-
-
- 在所选 LUN 上找到现有 SR。请单击“重新连接”以使用现有 SR,或者单击“格式化”以销毁磁盘上现有的任何数据并创建一个新 SR。
-
-警告: 为避免数据丢失,必须确保该 LUN 未由其他任何系统(包括未连接到 [XenCenter] 的服务器)使用。
-
-
- labelMessage
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 2
-
-
- Left
-
-
- True
-
-
- Segoe UI, 9pt
-
-
- 43, 110
-
-
- 5, 5, 5, 5
-
-
- 115, 31
-
-
- 7
-
-
- SR 大小: 5.0 GB
-SR UUID: abc-123-456
-
-
- labelSRinfo
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 3
-
-
- Segoe UI, 9pt
-
-
- 9, 10
-
-
- 0, 0, 0, 0
-
-
- 3
-
-
- 393, 186
-
-
- 0
-
-
- tableLayoutPanel1
-
-
- System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 0
-
-
- <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="pictureBoxIcon" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="flowLayoutPanelButtons" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelMessage" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelSRinfo" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings>
-
-
- True
-
-
- 96, 96
-
-
- True
-
-
- 411, 205
-
-
- Tahoma, 8pt
-
-
- 0, 0, 0, 0
-
-
- 9, 10, 9, 10
-
-
- CenterParent
-
-
- 新建存储库
-
-
- IscsiChoicesDialog
-
-
- XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
-
-
diff --git a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs
index 635954019..7909b6ea2 100644
--- a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs
+++ b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs
@@ -33,10 +33,9 @@ using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
-using XenAdmin.Actions;
using XenAdmin.Core;
using XenAdmin.Network;
-using XenAdmin.Wizards.NewSRWizard_Pages.Frontends;
+using XenAdmin.Wizards.NewSRWizard_Pages;
using XenAPI;
namespace XenAdmin.Dialogs.WarningDialogs
@@ -44,22 +43,22 @@ namespace XenAdmin.Dialogs.WarningDialogs
public partial class LVMoHBAWarningDialog : XenDialogBase
{
private Panel highlightedPanel;
- private FibreChannelDevice currentDevice;
+ private string deviceDetails;
private int remainingDevicesCount;
private bool foundExistingSR;
private readonly SR.SRTypes existingSrType;
private readonly SR.SRTypes requestedSrType;
private readonly IXenConnection _connection;
- public LVMoHBA.UserSelectedOption SelectedOption { get; private set; }
+ public UserSelectedOption SelectedOption { get; private set; }
public bool RepeatForRemainingLUNs => checkBoxRepeat.Checked;
- public LVMoHBAWarningDialog(IXenConnection connection, FibreChannelDevice currentDevice, int remainingDevicesCount,
+ public LVMoHBAWarningDialog(IXenConnection connection, string deviceDetails, int remainingDevicesCount,
bool foundExistingSR, SR.SRTypes existingSrType, SR.SRTypes requestedSrType)
{
InitializeComponent();
_connection = connection;
- this.currentDevice = currentDevice;
+ this.deviceDetails = deviceDetails;
this.remainingDevicesCount = remainingDevicesCount;
this.foundExistingSR = foundExistingSR;
this.existingSrType = existingSrType;
@@ -85,7 +84,7 @@ namespace XenAdmin.Dialogs.WarningDialogs
{
if (panel == null)
return;
-
+
Color color = highlighted ? SystemColors.ControlLight : SystemColors.Control;
panel.BackColor = color;
@@ -109,7 +108,7 @@ namespace XenAdmin.Dialogs.WarningDialogs
HighlightedPanel = panelFormat;
}
- private void ExistingSRsWarningDialog_MouseEnter(object sender, EventArgs e)
+ private void LVMoHBAWarningDialog_MouseEnter(object sender, EventArgs e)
{
HighlightedPanel = null;
}
@@ -125,11 +124,8 @@ namespace XenAdmin.Dialogs.WarningDialogs
: Messages.LVMOHBA_WARNING_DIALOG_REPEAT_FOR_REMAINING_NO_SR;
checkBoxRepeat.Visible = remainingDevicesCount > 0;
- labelLUNDetails.Text = string.Format(Messages.LVMOHBA_WARNING_DIALOG_LUN_DETAILS,
- currentDevice.Vendor,
- currentDevice.Serial,
- string.IsNullOrEmpty(currentDevice.SCSIid) ? currentDevice.Path : currentDevice.SCSIid,
- Util.DiskSizeString(currentDevice.Size));
+ labelLUNDetails.Text = deviceDetails;
+ labelSrDetails.Visible = false;
var isGfs2 = existingSrType == SR.SRTypes.gfs2;
var clusteringEnabled = _connection.Cache.Clusters.Any();
@@ -160,21 +156,69 @@ namespace XenAdmin.Dialogs.WarningDialogs
private void buttonCancel_Click(object sender, EventArgs e)
{
- SelectedOption = LVMoHBA.UserSelectedOption.Cancel;
+ SelectedOption = UserSelectedOption.Cancel;
}
private void panelReattach_Click(object sender, EventArgs e)
{
HighlightedPanel = panelReattach;
- SelectedOption = LVMoHBA.UserSelectedOption.Reattach;
+ SelectedOption = UserSelectedOption.Reattach;
DialogResult = DialogResult.OK;
}
private void panelFormat_Click(object sender, EventArgs e)
{
HighlightedPanel = panelFormat;
- SelectedOption = LVMoHBA.UserSelectedOption.Format;
+ SelectedOption = UserSelectedOption.Format;
DialogResult = DialogResult.OK;
}
+
+
+ public enum UserSelectedOption
+ {
+ Cancel,
+ Reattach,
+ Format,
+ Skip
+ }
+ }
+
+ public class LVMoIsciWarningDialog : LVMoHBAWarningDialog
+ {
+ public LVMoIsciWarningDialog(IXenConnection connection, SR.SRInfo srInfo, SR.SRTypes existingSrType, SR.SRTypes requestedSrType)
+ : base(connection, "", 0, srInfo != null, existingSrType, requestedSrType)
+ {
+ labelLUNDetails.Visible = false;
+ labelSrDetails.Visible = srInfo != null;
+
+ // CA-17230: if the found SR is used by other connected pools, offer only to attach it
+
+ if (srInfo != null)
+ {
+ SR sr = SrWizardHelpers.SrInUse(srInfo.UUID);
+ if (sr != null)
+ {
+ panelFormat.Visible = false;
+ labelWarning.Text = GetSrInUseMessage(sr);
+ }
+
+ labelSrDetails.Text = string.Format(Messages.ISCSI_DIALOG_SR_DETAILS, Util.DiskSizeString(srInfo.Size), srInfo.UUID);
+ }
+ }
+
+ public static string GetSrInUseMessage(SR sr)
+ {
+ Pool pool = Helpers.GetPool(sr.Connection);
+
+ if (pool != null)
+ return string.Format(Messages.NEWSR_LUN_IN_USE_ON_POOL, sr.Name(), pool.Name());
+
+ Host master = Helpers.GetMaster(sr.Connection);
+
+ if (master != null)
+ return string.Format(Messages.NEWSR_LUN_IN_USE_ON_SERVER, sr.Name(), master.Name());
+
+ return Messages.NEWSR_LUN_IN_USE;
+ }
}
}
diff --git a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.designer.cs b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.designer.cs
index 7a7ccd477..5fd1b1116 100644
--- a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.designer.cs
+++ b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.designer.cs
@@ -44,11 +44,16 @@
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.labelWarning = new System.Windows.Forms.Label();
this.labelLUNDetails = new System.Windows.Forms.Label();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.labelSrDetails = new System.Windows.Forms.Label();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.panelReattach.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxArrowReattach)).BeginInit();
this.panelFormat.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxArrowFormat)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+ this.tableLayoutPanel1.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// buttonCancel
@@ -159,6 +164,7 @@
// pictureBox2
//
resources.ApplyResources(this.pictureBox2, "pictureBox2");
+ this.pictureBox2.Image = global::XenAdmin.Properties.Resources._000_WarningAlert_h32bit_32;
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.TabStop = false;
//
@@ -172,21 +178,39 @@
resources.ApplyResources(this.labelLUNDetails, "labelLUNDetails");
this.labelLUNDetails.Name = "labelLUNDetails";
//
+ // tableLayoutPanel1
+ //
+ resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
+ this.tableLayoutPanel1.Controls.Add(this.labelLUNDetails, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.labelHeader, 0, 1);
+ this.tableLayoutPanel1.Controls.Add(this.labelSrDetails, 0, 2);
+ this.tableLayoutPanel1.Controls.Add(this.labelSelectOption, 0, 3);
+ this.tableLayoutPanel1.Controls.Add(this.panelReattach, 0, 4);
+ this.tableLayoutPanel1.Controls.Add(this.panelFormat, 0, 5);
+ this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 6);
+ this.tableLayoutPanel1.Controls.Add(this.checkBoxRepeat, 0, 7);
+ this.tableLayoutPanel1.Controls.Add(this.buttonCancel, 0, 8);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ //
+ // labelSrDetails
+ //
+ resources.ApplyResources(this.labelSrDetails, "labelSrDetails");
+ this.labelSrDetails.Name = "labelSrDetails";
+ //
+ // tableLayoutPanel2
+ //
+ resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2");
+ this.tableLayoutPanel2.Controls.Add(this.pictureBox2, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.labelWarning, 1, 0);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ //
// LVMoHBAWarningDialog
//
resources.ApplyResources(this, "$this");
this.CancelButton = this.buttonCancel;
- this.Controls.Add(this.labelLUNDetails);
- this.Controls.Add(this.labelWarning);
- this.Controls.Add(this.pictureBox2);
- this.Controls.Add(this.panelFormat);
- this.Controls.Add(this.panelReattach);
- this.Controls.Add(this.labelSelectOption);
- this.Controls.Add(this.labelHeader);
- this.Controls.Add(this.checkBoxRepeat);
- this.Controls.Add(this.buttonCancel);
+ this.Controls.Add(this.tableLayoutPanel1);
this.Name = "LVMoHBAWarningDialog";
- this.MouseEnter += new System.EventHandler(this.ExistingSRsWarningDialog_MouseEnter);
+ this.MouseEnter += new System.EventHandler(this.LVMoHBAWarningDialog_MouseEnter);
this.panelReattach.ResumeLayout(false);
this.panelReattach.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxArrowReattach)).EndInit();
@@ -194,6 +218,10 @@
this.panelFormat.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxArrowFormat)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -206,15 +234,18 @@
private System.Windows.Forms.Label labelHeader;
private System.Windows.Forms.Label labelSelectOption;
private XenAdmin.Controls.FlickerFreePanel panelReattach;
- private XenAdmin.Controls.FlickerFreePanel panelFormat;
- private System.Windows.Forms.PictureBox pictureBox2;
- private System.Windows.Forms.Label labelWarning;
+ protected XenAdmin.Controls.FlickerFreePanel panelFormat;
+ protected System.Windows.Forms.PictureBox pictureBox2;
+ protected System.Windows.Forms.Label labelWarning;
private System.Windows.Forms.PictureBox pictureBoxArrowReattach;
private System.Windows.Forms.PictureBox pictureBoxArrowFormat;
private System.Windows.Forms.Label labelReattachInfo;
private System.Windows.Forms.Label labelFormatInfo;
- private System.Windows.Forms.Label labelLUNDetails;
+ protected System.Windows.Forms.Label labelLUNDetails;
private System.Windows.Forms.Button buttonReattach;
private System.Windows.Forms.Button buttonFormat;
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+ protected System.Windows.Forms.Label labelSrDetails;
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
}
}
diff --git a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.resx b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.resx
index 0fc7056aa..eb5535043 100644
--- a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.resx
+++ b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.resx
@@ -119,21 +119,21 @@
- Bottom, Right
+ Top, Right
Segoe UI, 9pt
- 330, 338
+ 326, 391
- 75, 23
+ 75, 25
- 7
+ 8
Cancel
@@ -145,7 +145,7 @@
System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- $this
+ tableLayoutPanel1
8
@@ -163,20 +163,20 @@
Segoe UI, 9pt
- 12, 341
+ 3, 366
+
+
+ 3, 10, 3, 3
292, 19
- 6
+ 7
Do this for all remaining LUNs without existing SRs
-
- TopLeft
-
checkBoxRepeat
@@ -184,7 +184,7 @@
System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- $this
+ tableLayoutPanel1
7
@@ -196,7 +196,10 @@
Segoe UI, 9pt, style=Bold
- 9, 81
+ 3, 70
+
+
+ 3, 0, 3, 10
266, 15
@@ -214,10 +217,10 @@
System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- $this
+ tableLayoutPanel1
- 6
+ 1
True
@@ -226,16 +229,19 @@
Segoe UI, 9pt
- 9, 108
+ 3, 135
+
+
+ 3, 0, 3, 10
- 199, 15
+ 202, 15
- 2
+ 3
- Click the option below to add the SR
+ Click the option below to add the SR.
labelSelectOption
@@ -244,10 +250,10 @@
System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- $this
+ tableLayoutPanel1
- 5
+ 3
Top, Left, Right
@@ -349,13 +355,13 @@
Segoe UI, 9pt
- 12, 135
+ 3, 163
- 393, 62
+ 398, 62
- 3
+ 4
panelReattach
@@ -364,7 +370,7 @@
XenAdmin.Controls.FlickerFreePanel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- $this
+ tableLayoutPanel1
4
@@ -475,13 +481,13 @@
Segoe UI, 9pt
- 12, 199
+ 3, 231
- 393, 64
+ 398, 64
- 4
+ 5
panelFormat
@@ -490,65 +496,23 @@
XenAdmin.Controls.FlickerFreePanel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- $this
+ tableLayoutPanel1
- 3
-
-
- Bottom, Left
+ 5
Segoe UI, 9pt
-
-
- iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAABudJREFUWEe9V2ls
- VFUUPu10GbpIS5ku0CndABss0LpF44KBRMXIEtGAiIWChBaEAgVcE7fEYAzu+sOoPxQhGjdcgqDiSilK
- EbQgCC1t6bSd7st02qGdz++8uZVGxAWLJ/ny7nv33LOfc2fkXAiwRwPxs83r/0t+BI0FQjuAcADyaXZ2
- XoTZOv9EhaGdnYIeL5cIoLQ0oTUyeu1Cw3J+qatTXna7Bf0+G5Vf9LsRs2+ZiYiodUWG7fxQn0+Gu+sE
- jQ0Cf38CFS8D/CwFGrD7OwfC7es6Ro9eMc6wDz152mRTbZWgo1m9TiRyiDT4PIEoTJ8+B1ExRS8a9qGn
- hhpBw0lBb1cIFcYSw4gL4e8JGLBrRyJs4Ws9Y1LXJ5sjQ0eeZnmqrlLQXq/KLjDKdZ1MxANdXPsFN94w
- BxHRGzaZY0ND/i4JcVdLf8MJKvFo8cXB77Xhm+3BXEcQGUBPEJ+Cj95zIsS+oSktbanTHP/v5HHLI66j
- gi5XwPstb8ZCJIgQwo6aahpAo/rauH9KMGXKXETHrHk8cHoIqOG4wE2gLeC9SBgxDBEymc8c3HHzRH5P
- ATgf4BNs25oKCbmncUxmYZwRce7U7ZJHXYcFbRp+K/eRVKrej0SiTONzKmZdNYHfHQRroYl8NOS6a+fB
- HrnhASPm3KnxiHTU/yLw1Qe8B4IRE6ERcMIh1/B5He6+NZ3fdT8T0BbllNz88jjYwu6tyhybd+5R8NbI
- 6tqDrPxfKbSb3puhc/uMKCqehBT7dIwKvh6bN6lhGiGmodeBU7VcdwgmTc5H9Ig1xUbcvyd3ufjqf+bc
- r2Xfn6ISqwZY6a9rCrJxedoyXD1+Jmp+YDfo3eCN4j7vKU5LtAteez4LYru/alzW/Egj8p9Td6WsOVkm
- aC6nsBZ63k3oDOgX/PiZVn86Zk15FtNyZliFZ4WeI9qKgofGVnNgcWrm5i5EXMLKVUbsPyf3QWlw0YDO
- I+xvTwzgDgW0DemZGjI+IRMF83dgyaxc7hvlnJLo0kJNga+C61bBCxsnwhZZ/IsjsTjKiP576q2QhSf3
- cuzuF/TV2plPeq/CNbfWJBTMnZbCKDyAt55h5WsE1DiOatTpmE6Bv96OHq0dfsscfxcSk5YvM+L/npoP
- Skvd97x0rPCr9zSCIbUUqCEcuU/e76QBhSh7N4yFZ74z5Ba8NKp3NHrZvhqZFzdmI5RRiI1dazMqzk6+
- Y5LnovdN++h9FX/xtPPSqWIaeA9YUAVMw+63oxAuN6FpLwuQoba+674OLJf+UmJLVtM4vnfSkQkX5cOR
- VJRv1JydWvdLdX0pD7H90Ezldbx0VKhC86pKmIqewzY4Y6YG3jUtujfAd4zwJjEKTvjYRbr/9EM5CIsu
- LosbWRRiVJ1JPYdlSX0JK58R8FeypVpGUCC911wqVLAqUG8Z8l2vcV/rQt91T3l0n4PL8h5Z5ItE36HA
- 9wuzliA+aXWeUXcmNZZIb913Au+PDGvTSOac3h/hYQUvI0uBeqrjVttOq7+R0AioAQM8yq/572AU+sei
- X6PAGnp1YxZsUesPj4grPLMWvAdl8cldzP1uev8rr9h6hn9AkEK9UgX8PVi6VUex3ojhGJ+Uij4tVo2C
- 8iuf8uu3YxxcfRxMlZT3k8DDts7OXow45/IVRu1paimR464vOXaZf9Sw8o8zhCpErdcQKtQAepuZpMp1
- GCURubh3QRqnJPdUsfLpuQE0MJIt7IgfuKaRjxVfhmHD1/0U71geFtBM6imTK2o/Z99/xco/wAquYd+r
- IFptGTAA9Y63okgIEYecUYuQErkKD+YvCKREzwzw6lnFUQ6wNifrIAx9jEAHa8yRtBLOlLvmG/UinXvk
- uert/LXLCOBnDpIjxCEW3x+hU5Fz/uYrE2lAAhJCF+OLbcD2V2YGitGKwCD+cvM8wYIuD4dnT4Bn7owZ
- iHasKjHq+YPjSzlQ8bGgdgdT8G0QummlpyQInlIDs/bupbADFMJcP1qQhg2LbsOHL10NsGV7Obi6mb7B
- /J49lEWlXqL9W0ErI6xReXL9xQgbvhrpGUU5lgEdX8sT5e8Ijn4gqPhIUPnh2VFlDPWxVfuotJ1Cqz8R
- nDjLuQpC92oY4VaNMMf7rOtnIzZhFcakLz39R8b1qew8+r7g+83B2PdGEPa9KXz+AeZb2WbBfq73bwms
- Fdbe4DOD1rp/6C3B8W3BeHj5ZYgasRbO1AKkZRTcadQHKPeSBXOyJ+Q35kxaiNzJf4W8P8Gf8QWQQ1ya
- uwCTJi7CBSPXYJSzEKkZS3cmpy+zG9WnaVjsfSmc2XfEjyqaT8y1kEyMNmt9DmDw+2BexeB3PhOIxOSV
- 89IyCu/MSC+Y6Ry3wrShyG9Ma+jY9II0TAAAAABJRU5ErkJggg==
-
-
NoControl
- 12, 271
+ 3, 3
32, 32
-
- AutoSize
-
12
@@ -559,25 +523,31 @@
System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- $this
+ tableLayoutPanel2
- 2
+ 0
- Bottom, Left, Right
+ Left, Right
+
+
+ True
Segoe UI, 9pt
- 51, 271
+ 41, 0
+
+
+ 354, 500
- 354, 54
+ 354, 45
- 5
+ 0
To prevent data loss you must ensure that the LUN is not in use by any other system, including [XenServer] hosts that are not connected to [XenCenter].
@@ -589,7 +559,7 @@
System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- $this
+ tableLayoutPanel2
1
@@ -597,14 +567,20 @@
True
+
+ Top
+
Segoe UI, 9pt
- 9, 9
+ 3, 0
+
+
+ 3, 0, 3, 10
- 85, 60
+ 398, 60
0
@@ -623,23 +599,159 @@ Size:
System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- $this
+ tableLayoutPanel1
0
+
+ True
+
+
+ GrowAndShrink
+
+
+ 1
+
+
+ True
+
+
+ Top
+
+
+ Segoe UI, 9pt
+
+
+ 3, 95
+
+
+ 3, 0, 3, 10
+
+
+ 398, 30
+
+
+ 1
+
+
+ SR size:
+SR UUID:
+
+
+ labelSrDetails
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 2
+
+
+ Left, Right
+
+
+ True
+
+
+ GrowAndShrink
+
+
+ 2
+
+
+ Segoe UI, 9pt
+
+
+ 3, 308
+
+
+ 3, 10, 3, 3
+
+
+ 1
+
+
+ 398, 45
+
+
+ 6
+
+
+ tableLayoutPanel2
+
+
+ System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 6
+
+
+ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="pictureBox2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelWarning" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="Percent,100" /></TableLayoutSettings>
+
+
+ Top
+
+
+ Segoe UI, 9pt
+
+
+ 10, 10
+
+
+ 9
+
+
+ 404, 419
+
+
+ 0
+
+
+ tableLayoutPanel1
+
+
+ System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 0
+
+
+ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelLUNDetails" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelHeader" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelSrDetails" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelSelectOption" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="panelReattach" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="panelFormat" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel2" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBoxRepeat" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonCancel" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings>
+
True
96, 96
+
+ True
+
+
+ GrowAndShrink
+
- 417, 373
+ 424, 461
Segoe UI, 9pt
+
+ 440, 100
+
+
+ 10, 10, 10, 10
+
New Storage Repository
diff --git a/XenAdmin/Utils/TemporaryDisablerForControls.cs b/XenAdmin/Utils/TemporaryDisablerForControls.cs
deleted file mode 100644
index 52b9677ec..000000000
--- a/XenAdmin/Utils/TemporaryDisablerForControls.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Copyright (c) Citrix Systems, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * * Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the
- * following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the
- * following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace XenAdmin.Utils
-{
- ///
- /// Utility class that can remember Enabled states of controls provided. Original Enabled values can be restored.
- ///
- internal class TemporaryDisablerForControls
- {
- ///
- /// Stores controls as Keys and their original Enabled states as Values.
- ///
- private readonly Dictionary savedEnabledStatesOfControls = new Dictionary();
-
- ///
- /// Saves the current Enabled values of the controls provided.
- ///
- /// This does not clear previously saved data, but update the ones that were saved before and provided again.
- ///
- public void SaveOrUpdateEnabledStates(IEnumerable controls)
- {
- if (controls == null)
- throw new ArgumentNullException("controls");
-
- foreach (var control in controls)
- {
- if (control == null)
- continue;
-
- if (savedEnabledStatesOfControls.ContainsKey(control))
- savedEnabledStatesOfControls[control] = control.Enabled;
- else
- savedEnabledStatesOfControls.Add(control, control.Enabled);
- }
- }
-
- ///
- /// Clears all previously saved data.
- ///
- public void Reset()
- {
- savedEnabledStatesOfControls.Clear();
- }
-
- ///
- /// Sets Enabled property to false on every control that was saved before.
- ///
- public void DisableAllControls()
- {
- foreach (var kvp in savedEnabledStatesOfControls)
- kvp.Key.Enabled = false;
- }
-
- ///
- /// Restores original Enabled property values on all controls that was saved before.
- ///
- public void RestoreEnabledOnAllControls()
- {
- foreach (var kvp in savedEnabledStatesOfControls)
- kvp.Key.Enabled = kvp.Value;
- }
- }
-
-}
diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs
index c6d601b2d..15d4c540e 100644
--- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs
+++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs
@@ -401,6 +401,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
return false;
}
+
#region Accessors
public List FCDevices { private get; set; }
@@ -498,8 +499,6 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
}
}
- public enum UserSelectedOption { Cancel, Reattach, Format, Skip }
-
private class LVMoHBAWarningDialogLauncher
{
private readonly Dictionary inputSrDescriptors;
@@ -519,10 +518,16 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
SrDescriptors = new List();
}
- private UserSelectedOption GetSelectedOption(FibreChannelDescriptor descriptor, int remainingCount, bool foundExistingSr,
+ private LVMoHBAWarningDialog.UserSelectedOption GetSelectedOption(FibreChannelDescriptor descriptor, int remainingCount, bool foundExistingSr,
SR.SRTypes existingSrType, out bool repeatForRemainingLUNs)
{
- using (var dialog = new LVMoHBAWarningDialog(_connection, descriptor.Device, remainingCount, foundExistingSr, existingSrType, requestedSrType))
+ var deviceDetails = string.Format(Messages.LVMOHBA_WARNING_DIALOG_LUN_DETAILS,
+ descriptor.Device.Vendor,
+ descriptor.Device.Serial,
+ string.IsNullOrEmpty(descriptor.Device.SCSIid) ? descriptor.Device.Path : descriptor.Device.SCSIid,
+ Util.DiskSizeString(descriptor.Device.Size));
+
+ using (var dialog = new LVMoHBAWarningDialog(_connection, deviceDetails, remainingCount, foundExistingSr, existingSrType, requestedSrType))
{
dialog.ShowDialog(owner);
repeatForRemainingLUNs = dialog.RepeatForRemainingLUNs;
@@ -534,8 +539,9 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
{
// process LUNs where existing SRs have been found
bool repeatForRemainingLUNs = false;
- UserSelectedOption selectedOption = UserSelectedOption.Cancel;
+ var selectedOption = LVMoHBAWarningDialog.UserSelectedOption.Cancel;
var descriptors = inputSrDescriptors.Keys.Where(d => inputSrDescriptors[d] != null).ToList();
+
foreach (var descriptor in descriptors)
{
if (!repeatForRemainingLUNs)
@@ -553,7 +559,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
// process LUNs where no existing have been found
repeatForRemainingLUNs = false;
- selectedOption = UserSelectedOption.Cancel;
+ selectedOption = LVMoHBAWarningDialog.UserSelectedOption.Cancel;
descriptors = inputSrDescriptors.Keys.Where(d => inputSrDescriptors[d] == null).ToList();
foreach (var descriptor in descriptors)
@@ -568,18 +574,18 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
}
}
- private void ProcessSelectedOption(UserSelectedOption selectedOption, FibreChannelDescriptor descriptor)
+ private void ProcessSelectedOption(LVMoHBAWarningDialog.UserSelectedOption selectedOption, FibreChannelDescriptor descriptor)
{
switch (selectedOption)
{
- case UserSelectedOption.Format:
+ case LVMoHBAWarningDialog.UserSelectedOption.Format:
descriptor.UUID = null;
SrDescriptors.Add(descriptor); // descriptor of requested SR
break;
- case UserSelectedOption.Reattach:
+ case LVMoHBAWarningDialog.UserSelectedOption.Reattach:
SrDescriptors.Add(inputSrDescriptors[descriptor]); // value = descriptor of existing SR
break;
- case UserSelectedOption.Cancel:
+ case LVMoHBAWarningDialog.UserSelectedOption.Cancel:
SrDescriptors.Clear();
Cancelled = true;
return;
diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.Designer.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.Designer.cs
index 759864b05..92382391e 100644
--- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.Designer.cs
+++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.Designer.cs
@@ -33,40 +33,44 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.iSCSITargetGroupBox = new XenAdmin.Controls.DecentGroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
- this.labelIscsiIQN = new System.Windows.Forms.Label();
+ this.labelTargetIqn = new System.Windows.Forms.Label();
this.comboBoxIscsiIqns = new System.Windows.Forms.ComboBox();
this.comboBoxIscsiLuns = new System.Windows.Forms.ComboBox();
- this.targetLunLabel = new System.Windows.Forms.Label();
- this.errorLabelAtTargetLUN = new System.Windows.Forms.Label();
- this.errorIconAtTargetLUN = new System.Windows.Forms.PictureBox();
+ this.labelTargetLun = new System.Windows.Forms.Label();
this.spinnerIconAtTargetIqn = new XenAdmin.Controls.SpinnerIcon();
this.spinnerIconAtTargetLun = new XenAdmin.Controls.SpinnerIcon();
- this.errorLabelAtCHAPPassword = new System.Windows.Forms.Label();
- this.errorIconAtCHAPPassword = new System.Windows.Forms.PictureBox();
- this.errorIconAtHostOrIP = new System.Windows.Forms.PictureBox();
- this.scanTargetHostButton = new System.Windows.Forms.Button();
+ this.errorIconAtTargetLUN = new System.Windows.Forms.PictureBox();
+ this.errorLabelAtTargetLUN = new System.Windows.Forms.Label();
+ this.buttonScanTargetHost = new System.Windows.Forms.Button();
this.labelIscsiTargetHost = new System.Windows.Forms.Label();
this.textBoxIscsiHost = new System.Windows.Forms.TextBox();
this.labelColon = new System.Windows.Forms.Label();
this.textBoxIscsiPort = new System.Windows.Forms.TextBox();
- this.IScsiChapUserTextBox = new System.Windows.Forms.TextBox();
- this.IScsiChapSecretTextBox = new System.Windows.Forms.TextBox();
+ this.textBoxChapUser = new System.Windows.Forms.TextBox();
+ this.textBoxChapPassword = new System.Windows.Forms.TextBox();
this.labelCHAPuser = new System.Windows.Forms.Label();
this.IScsiChapSecretLabel = new System.Windows.Forms.Label();
- this.IscsiUseChapCheckBox = new System.Windows.Forms.CheckBox();
this.label11 = new System.Windows.Forms.Label();
- this.errorLabelAtHostname = new System.Windows.Forms.Label();
this.spinnerIconAtScanTargetHostButton = new XenAdmin.Controls.SpinnerIcon();
- this.toolTipContainerIQNscan = new XenAdmin.Controls.ToolTipContainer();
+ this.tableLayoutPanelError = new System.Windows.Forms.TableLayoutPanel();
+ this.errorIconBottom = new System.Windows.Forms.PictureBox();
+ this.errorLabelBottom = new System.Windows.Forms.Label();
+ this.errorIconAtHostOrIP = new System.Windows.Forms.PictureBox();
+ this.errorLabelAtHostOrIP = new System.Windows.Forms.Label();
+ this.errorIconAtCHAPPassword = new System.Windows.Forms.PictureBox();
+ this.errorLabelAtCHAPPassword = new System.Windows.Forms.Label();
+ this.checkBoxUseChap = new System.Windows.Forms.CheckBox();
this.tableLayoutPanel1.SuspendLayout();
this.iSCSITargetGroupBox.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.errorIconAtTargetLUN)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spinnerIconAtTargetIqn)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spinnerIconAtTargetLun)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.errorIconAtCHAPPassword)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.errorIconAtHostOrIP)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.errorIconAtTargetLUN)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spinnerIconAtScanTargetHostButton)).BeginInit();
+ this.tableLayoutPanelError.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.errorIconBottom)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.errorIconAtHostOrIP)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.errorIconAtCHAPPassword)).BeginInit();
this.SuspendLayout();
//
// lunInUseLabel
@@ -77,29 +81,30 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
// tableLayoutPanel1
//
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
- this.tableLayoutPanel1.Controls.Add(this.iSCSITargetGroupBox, 0, 8);
- this.tableLayoutPanel1.Controls.Add(this.errorLabelAtCHAPPassword, 3, 6);
- this.tableLayoutPanel1.Controls.Add(this.errorIconAtCHAPPassword, 2, 6);
- this.tableLayoutPanel1.Controls.Add(this.errorIconAtHostOrIP, 2, 2);
- this.tableLayoutPanel1.Controls.Add(this.scanTargetHostButton, 0, 7);
- this.tableLayoutPanel1.Controls.Add(this.labelIscsiTargetHost, 0, 1);
- this.tableLayoutPanel1.Controls.Add(this.textBoxIscsiHost, 2, 1);
- this.tableLayoutPanel1.Controls.Add(this.labelColon, 3, 1);
- this.tableLayoutPanel1.Controls.Add(this.textBoxIscsiPort, 4, 1);
- this.tableLayoutPanel1.Controls.Add(this.IScsiChapUserTextBox, 2, 4);
- this.tableLayoutPanel1.Controls.Add(this.IScsiChapSecretTextBox, 2, 5);
- this.tableLayoutPanel1.Controls.Add(this.labelCHAPuser, 1, 4);
- this.tableLayoutPanel1.Controls.Add(this.IScsiChapSecretLabel, 1, 5);
- this.tableLayoutPanel1.Controls.Add(this.IscsiUseChapCheckBox, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.label11, 0, 0);
- this.tableLayoutPanel1.Controls.Add(this.errorLabelAtHostname, 3, 2);
- this.tableLayoutPanel1.Controls.Add(this.spinnerIconAtScanTargetHostButton, 2, 7);
+ this.tableLayoutPanel1.Controls.Add(this.labelIscsiTargetHost, 0, 1);
+ this.tableLayoutPanel1.Controls.Add(this.textBoxIscsiHost, 1, 1);
+ this.tableLayoutPanel1.Controls.Add(this.labelColon, 2, 1);
+ this.tableLayoutPanel1.Controls.Add(this.textBoxIscsiPort, 3, 1);
+ this.tableLayoutPanel1.Controls.Add(this.errorIconAtHostOrIP, 1, 2);
+ this.tableLayoutPanel1.Controls.Add(this.errorLabelAtHostOrIP, 2, 2);
+ this.tableLayoutPanel1.Controls.Add(this.checkBoxUseChap, 0, 3);
+ this.tableLayoutPanel1.Controls.Add(this.labelCHAPuser, 0, 4);
+ this.tableLayoutPanel1.Controls.Add(this.textBoxChapUser, 1, 4);
+ this.tableLayoutPanel1.Controls.Add(this.IScsiChapSecretLabel, 0, 5);
+ this.tableLayoutPanel1.Controls.Add(this.textBoxChapPassword, 1, 5);
+ this.tableLayoutPanel1.Controls.Add(this.errorIconAtCHAPPassword, 1, 6);
+ this.tableLayoutPanel1.Controls.Add(this.errorLabelAtCHAPPassword, 2, 6);
+ this.tableLayoutPanel1.Controls.Add(this.buttonScanTargetHost, 0, 7);
+ this.tableLayoutPanel1.Controls.Add(this.spinnerIconAtScanTargetHostButton, 1, 7);
+ this.tableLayoutPanel1.Controls.Add(this.iSCSITargetGroupBox, 0, 8);
+ this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanelError, 0, 9);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
//
// iSCSITargetGroupBox
//
resources.ApplyResources(this.iSCSITargetGroupBox, "iSCSITargetGroupBox");
- this.tableLayoutPanel1.SetColumnSpan(this.iSCSITargetGroupBox, 6);
+ this.tableLayoutPanel1.SetColumnSpan(this.iSCSITargetGroupBox, 5);
this.iSCSITargetGroupBox.Controls.Add(this.tableLayoutPanel2);
this.iSCSITargetGroupBox.Name = "iSCSITargetGroupBox";
this.iSCSITargetGroupBox.TabStop = false;
@@ -107,21 +112,21 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
// tableLayoutPanel2
//
resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2");
- this.tableLayoutPanel2.Controls.Add(this.labelIscsiIQN, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.labelTargetIqn, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.comboBoxIscsiIqns, 1, 0);
- this.tableLayoutPanel2.Controls.Add(this.comboBoxIscsiLuns, 1, 1);
- this.tableLayoutPanel2.Controls.Add(this.targetLunLabel, 0, 1);
- this.tableLayoutPanel2.Controls.Add(this.errorLabelAtTargetLUN, 2, 2);
- this.tableLayoutPanel2.Controls.Add(this.errorIconAtTargetLUN, 1, 2);
this.tableLayoutPanel2.Controls.Add(this.spinnerIconAtTargetIqn, 3, 0);
+ this.tableLayoutPanel2.Controls.Add(this.labelTargetLun, 0, 1);
+ this.tableLayoutPanel2.Controls.Add(this.comboBoxIscsiLuns, 1, 1);
this.tableLayoutPanel2.Controls.Add(this.spinnerIconAtTargetLun, 3, 1);
+ this.tableLayoutPanel2.Controls.Add(this.errorIconAtTargetLUN, 1, 2);
+ this.tableLayoutPanel2.Controls.Add(this.errorLabelAtTargetLUN, 2, 2);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
//
- // labelIscsiIQN
+ // labelTargetIqn
//
- resources.ApplyResources(this.labelIscsiIQN, "labelIscsiIQN");
- this.labelIscsiIQN.BackColor = System.Drawing.Color.Transparent;
- this.labelIscsiIQN.Name = "labelIscsiIQN";
+ resources.ApplyResources(this.labelTargetIqn, "labelTargetIqn");
+ this.labelTargetIqn.BackColor = System.Drawing.Color.Transparent;
+ this.labelTargetIqn.Name = "labelTargetIqn";
//
// comboBoxIscsiIqns
//
@@ -130,7 +135,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
this.comboBoxIscsiIqns.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxIscsiIqns.FormattingEnabled = true;
this.comboBoxIscsiIqns.Name = "comboBoxIscsiIqns";
- this.comboBoxIscsiIqns.SelectedIndexChanged += new System.EventHandler(this.IScsiTargetIqnComboBox_SelectedIndexChanged);
+ this.comboBoxIscsiIqns.SelectedIndexChanged += new System.EventHandler(this.comboBoxIscsiIqns_SelectedIndexChanged);
//
// comboBoxIscsiLuns
//
@@ -141,25 +146,10 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
this.comboBoxIscsiLuns.Name = "comboBoxIscsiLuns";
this.comboBoxIscsiLuns.SelectedIndexChanged += new System.EventHandler(this.comboBoxIscsiLuns_SelectedIndexChanged);
//
- // targetLunLabel
+ // labelTargetLun
//
- resources.ApplyResources(this.targetLunLabel, "targetLunLabel");
- this.targetLunLabel.Name = "targetLunLabel";
- //
- // errorLabelAtTargetLUN
- //
- resources.ApplyResources(this.errorLabelAtTargetLUN, "errorLabelAtTargetLUN");
- this.errorLabelAtTargetLUN.AutoEllipsis = true;
- this.tableLayoutPanel2.SetColumnSpan(this.errorLabelAtTargetLUN, 2);
- this.errorLabelAtTargetLUN.ForeColor = System.Drawing.Color.Red;
- this.errorLabelAtTargetLUN.Name = "errorLabelAtTargetLUN";
- //
- // errorIconAtTargetLUN
- //
- resources.ApplyResources(this.errorIconAtTargetLUN, "errorIconAtTargetLUN");
- this.errorIconAtTargetLUN.Image = global::XenAdmin.Properties.Resources._000_error_h32bit_16;
- this.errorIconAtTargetLUN.Name = "errorIconAtTargetLUN";
- this.errorIconAtTargetLUN.TabStop = false;
+ resources.ApplyResources(this.labelTargetLun, "labelTargetLun");
+ this.labelTargetLun.Name = "labelTargetLun";
//
// spinnerIconAtTargetIqn
//
@@ -173,40 +163,29 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
this.spinnerIconAtTargetLun.Name = "spinnerIconAtTargetLun";
this.spinnerIconAtTargetLun.TabStop = false;
//
- // errorLabelAtCHAPPassword
+ // errorIconAtTargetLUN
//
- resources.ApplyResources(this.errorLabelAtCHAPPassword, "errorLabelAtCHAPPassword");
- this.errorLabelAtCHAPPassword.AutoEllipsis = true;
- this.tableLayoutPanel1.SetColumnSpan(this.errorLabelAtCHAPPassword, 3);
- this.errorLabelAtCHAPPassword.ForeColor = System.Drawing.Color.Red;
- this.errorLabelAtCHAPPassword.Name = "errorLabelAtCHAPPassword";
+ this.errorIconAtTargetLUN.Image = global::XenAdmin.Properties.Resources._000_error_h32bit_16;
+ resources.ApplyResources(this.errorIconAtTargetLUN, "errorIconAtTargetLUN");
+ this.errorIconAtTargetLUN.Name = "errorIconAtTargetLUN";
+ this.errorIconAtTargetLUN.TabStop = false;
//
- // errorIconAtCHAPPassword
+ // errorLabelAtTargetLUN
//
- resources.ApplyResources(this.errorIconAtCHAPPassword, "errorIconAtCHAPPassword");
- this.errorIconAtCHAPPassword.Image = global::XenAdmin.Properties.Resources._000_error_h32bit_16;
- this.errorIconAtCHAPPassword.Name = "errorIconAtCHAPPassword";
- this.errorIconAtCHAPPassword.TabStop = false;
+ resources.ApplyResources(this.errorLabelAtTargetLUN, "errorLabelAtTargetLUN");
+ this.errorLabelAtTargetLUN.ForeColor = System.Drawing.Color.Red;
+ this.errorLabelAtTargetLUN.Name = "errorLabelAtTargetLUN";
//
- // errorIconAtHostOrIP
+ // buttonScanTargetHost
//
- resources.ApplyResources(this.errorIconAtHostOrIP, "errorIconAtHostOrIP");
- this.errorIconAtHostOrIP.Image = global::XenAdmin.Properties.Resources._000_error_h32bit_16;
- this.errorIconAtHostOrIP.Name = "errorIconAtHostOrIP";
- this.errorIconAtHostOrIP.TabStop = false;
- //
- // scanTargetHostButton
- //
- resources.ApplyResources(this.scanTargetHostButton, "scanTargetHostButton");
- this.tableLayoutPanel1.SetColumnSpan(this.scanTargetHostButton, 2);
- this.scanTargetHostButton.Name = "scanTargetHostButton";
- this.scanTargetHostButton.Click += new System.EventHandler(this.scanTargetHostButton_Click);
+ resources.ApplyResources(this.buttonScanTargetHost, "buttonScanTargetHost");
+ this.buttonScanTargetHost.Name = "buttonScanTargetHost";
+ this.buttonScanTargetHost.Click += new System.EventHandler(this.buttonScanTargetHost_Click);
//
// labelIscsiTargetHost
//
resources.ApplyResources(this.labelIscsiTargetHost, "labelIscsiTargetHost");
this.labelIscsiTargetHost.BackColor = System.Drawing.Color.Transparent;
- this.tableLayoutPanel1.SetColumnSpan(this.labelIscsiTargetHost, 2);
this.labelIscsiTargetHost.Name = "labelIscsiTargetHost";
//
// textBoxIscsiHost
@@ -227,21 +206,21 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
this.textBoxIscsiPort.Name = "textBoxIscsiPort";
this.textBoxIscsiPort.TextChanged += new System.EventHandler(this.textBoxIscsiHost_TextChanged);
//
- // IScsiChapUserTextBox
+ // textBoxChapUser
//
- this.IScsiChapUserTextBox.AllowDrop = true;
- resources.ApplyResources(this.IScsiChapUserTextBox, "IScsiChapUserTextBox");
- this.tableLayoutPanel1.SetColumnSpan(this.IScsiChapUserTextBox, 2);
- this.IScsiChapUserTextBox.Name = "IScsiChapUserTextBox";
- this.IScsiChapUserTextBox.TextChanged += new System.EventHandler(this.ChapSettings_Changed);
+ this.textBoxChapUser.AllowDrop = true;
+ resources.ApplyResources(this.textBoxChapUser, "textBoxChapUser");
+ this.tableLayoutPanel1.SetColumnSpan(this.textBoxChapUser, 2);
+ this.textBoxChapUser.Name = "textBoxChapUser";
+ this.textBoxChapUser.TextChanged += new System.EventHandler(this.textBoxChapUser_TextChanged);
//
- // IScsiChapSecretTextBox
+ // textBoxChapPassword
//
- resources.ApplyResources(this.IScsiChapSecretTextBox, "IScsiChapSecretTextBox");
- this.tableLayoutPanel1.SetColumnSpan(this.IScsiChapSecretTextBox, 2);
- this.IScsiChapSecretTextBox.Name = "IScsiChapSecretTextBox";
- this.IScsiChapSecretTextBox.UseSystemPasswordChar = true;
- this.IScsiChapSecretTextBox.TextChanged += new System.EventHandler(this.ChapSettings_Changed);
+ resources.ApplyResources(this.textBoxChapPassword, "textBoxChapPassword");
+ this.tableLayoutPanel1.SetColumnSpan(this.textBoxChapPassword, 2);
+ this.textBoxChapPassword.Name = "textBoxChapPassword";
+ this.textBoxChapPassword.UseSystemPasswordChar = true;
+ this.textBoxChapPassword.TextChanged += new System.EventHandler(this.textBoxChapPassword_TextChanged);
//
// labelCHAPuser
//
@@ -255,57 +234,96 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
this.IScsiChapSecretLabel.BackColor = System.Drawing.Color.Transparent;
this.IScsiChapSecretLabel.Name = "IScsiChapSecretLabel";
//
- // IscsiUseChapCheckBox
- //
- resources.ApplyResources(this.IscsiUseChapCheckBox, "IscsiUseChapCheckBox");
- this.tableLayoutPanel1.SetColumnSpan(this.IscsiUseChapCheckBox, 6);
- this.IscsiUseChapCheckBox.Name = "IscsiUseChapCheckBox";
- this.IscsiUseChapCheckBox.UseVisualStyleBackColor = true;
- this.IscsiUseChapCheckBox.CheckedChanged += new System.EventHandler(this.IscsiUseChapCheckBox_CheckedChanged);
- //
// label11
//
resources.ApplyResources(this.label11, "label11");
- this.tableLayoutPanel1.SetColumnSpan(this.label11, 6);
+ this.tableLayoutPanel1.SetColumnSpan(this.label11, 5);
this.label11.Name = "label11";
//
- // errorLabelAtHostname
- //
- resources.ApplyResources(this.errorLabelAtHostname, "errorLabelAtHostname");
- this.errorLabelAtHostname.AutoEllipsis = true;
- this.tableLayoutPanel1.SetColumnSpan(this.errorLabelAtHostname, 3);
- this.errorLabelAtHostname.ForeColor = System.Drawing.Color.Red;
- this.errorLabelAtHostname.Name = "errorLabelAtHostname";
- //
// spinnerIconAtScanTargetHostButton
//
resources.ApplyResources(this.spinnerIconAtScanTargetHostButton, "spinnerIconAtScanTargetHostButton");
this.spinnerIconAtScanTargetHostButton.Name = "spinnerIconAtScanTargetHostButton";
this.spinnerIconAtScanTargetHostButton.TabStop = false;
//
- // toolTipContainerIQNscan
+ // tableLayoutPanelError
//
- resources.ApplyResources(this.toolTipContainerIQNscan, "toolTipContainerIQNscan");
- this.toolTipContainerIQNscan.Name = "toolTipContainerIQNscan";
+ resources.ApplyResources(this.tableLayoutPanelError, "tableLayoutPanelError");
+ this.tableLayoutPanel1.SetColumnSpan(this.tableLayoutPanelError, 5);
+ this.tableLayoutPanelError.Controls.Add(this.errorIconBottom, 0, 0);
+ this.tableLayoutPanelError.Controls.Add(this.errorLabelBottom, 1, 0);
+ this.tableLayoutPanelError.Name = "tableLayoutPanelError";
+ //
+ // errorIconBottom
+ //
+ this.errorIconBottom.Image = global::XenAdmin.Properties.Resources._000_error_h32bit_16;
+ resources.ApplyResources(this.errorIconBottom, "errorIconBottom");
+ this.errorIconBottom.Name = "errorIconBottom";
+ this.errorIconBottom.TabStop = false;
+ //
+ // errorLabelBottom
+ //
+ resources.ApplyResources(this.errorLabelBottom, "errorLabelBottom");
+ this.errorLabelBottom.ForeColor = System.Drawing.Color.Red;
+ this.errorLabelBottom.Name = "errorLabelBottom";
+ //
+ // errorIconAtHostOrIP
+ //
+ this.errorIconAtHostOrIP.Image = global::XenAdmin.Properties.Resources._000_error_h32bit_16;
+ resources.ApplyResources(this.errorIconAtHostOrIP, "errorIconAtHostOrIP");
+ this.errorIconAtHostOrIP.Name = "errorIconAtHostOrIP";
+ this.errorIconAtHostOrIP.TabStop = false;
+ //
+ // errorLabelAtHostOrIP
+ //
+ resources.ApplyResources(this.errorLabelAtHostOrIP, "errorLabelAtHostOrIP");
+ this.tableLayoutPanel1.SetColumnSpan(this.errorLabelAtHostOrIP, 3);
+ this.errorLabelAtHostOrIP.ForeColor = System.Drawing.Color.Red;
+ this.errorLabelAtHostOrIP.Name = "errorLabelAtHostOrIP";
+ //
+ // errorIconAtCHAPPassword
+ //
+ this.errorIconAtCHAPPassword.Image = global::XenAdmin.Properties.Resources._000_error_h32bit_16;
+ resources.ApplyResources(this.errorIconAtCHAPPassword, "errorIconAtCHAPPassword");
+ this.errorIconAtCHAPPassword.Name = "errorIconAtCHAPPassword";
+ this.errorIconAtCHAPPassword.TabStop = false;
+ //
+ // errorLabelAtCHAPPassword
+ //
+ resources.ApplyResources(this.errorLabelAtCHAPPassword, "errorLabelAtCHAPPassword");
+ this.tableLayoutPanel1.SetColumnSpan(this.errorLabelAtCHAPPassword, 3);
+ this.errorLabelAtCHAPPassword.ForeColor = System.Drawing.Color.Red;
+ this.errorLabelAtCHAPPassword.Name = "errorLabelAtCHAPPassword";
+ //
+ // checkBoxUseChap
+ //
+ resources.ApplyResources(this.checkBoxUseChap, "checkBoxUseChap");
+ this.tableLayoutPanel1.SetColumnSpan(this.checkBoxUseChap, 5);
+ this.checkBoxUseChap.Name = "checkBoxUseChap";
+ this.checkBoxUseChap.UseVisualStyleBackColor = true;
+ this.checkBoxUseChap.CheckedChanged += new System.EventHandler(this.checkBoxUseChap_CheckedChanged);
//
// LVMoISCSI
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.tableLayoutPanel1);
- this.Controls.Add(this.toolTipContainerIQNscan);
this.Name = "LVMoISCSI";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.iSCSITargetGroupBox.ResumeLayout(false);
+ this.iSCSITargetGroupBox.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.errorIconAtTargetLUN)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spinnerIconAtTargetIqn)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spinnerIconAtTargetLun)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.errorIconAtCHAPPassword)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.errorIconAtHostOrIP)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.errorIconAtTargetLUN)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spinnerIconAtScanTargetHostButton)).EndInit();
+ this.tableLayoutPanelError.ResumeLayout(false);
+ this.tableLayoutPanelError.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.errorIconBottom)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.errorIconAtHostOrIP)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.errorIconAtCHAPPassword)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -315,32 +333,34 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
private System.Windows.Forms.TextBox textBoxIscsiPort;
private System.Windows.Forms.Label labelColon;
- private XenAdmin.Controls.ToolTipContainer toolTipContainerIQNscan;
- private System.Windows.Forms.Button scanTargetHostButton;
- private System.Windows.Forms.CheckBox IscsiUseChapCheckBox;
+ private System.Windows.Forms.Button buttonScanTargetHost;
+ private System.Windows.Forms.CheckBox checkBoxUseChap;
private System.Windows.Forms.ComboBox comboBoxIscsiIqns;
private System.Windows.Forms.ComboBox comboBoxIscsiLuns;
- private System.Windows.Forms.Label errorLabelAtHostname;
private System.Windows.Forms.Label lunInUseLabel;
- private System.Windows.Forms.Label targetLunLabel;
+ private System.Windows.Forms.Label labelTargetLun;
private System.Windows.Forms.Label IScsiChapSecretLabel;
- private System.Windows.Forms.TextBox IScsiChapSecretTextBox;
+ private System.Windows.Forms.TextBox textBoxChapPassword;
private System.Windows.Forms.Label labelCHAPuser;
- private System.Windows.Forms.TextBox IScsiChapUserTextBox;
+ private System.Windows.Forms.TextBox textBoxChapUser;
private System.Windows.Forms.Label labelIscsiTargetHost;
- private System.Windows.Forms.Label labelIscsiIQN;
+ private System.Windows.Forms.Label labelTargetIqn;
private System.Windows.Forms.TextBox textBoxIscsiHost;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private XenAdmin.Controls.DecentGroupBox iSCSITargetGroupBox;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
- private System.Windows.Forms.PictureBox errorIconAtTargetLUN;
- private System.Windows.Forms.PictureBox errorIconAtHostOrIP;
- private System.Windows.Forms.PictureBox errorIconAtCHAPPassword;
- private System.Windows.Forms.Label errorLabelAtCHAPPassword;
- private System.Windows.Forms.Label errorLabelAtTargetLUN;
private XenAdmin.Controls.SpinnerIcon spinnerIconAtTargetIqn;
private XenAdmin.Controls.SpinnerIcon spinnerIconAtTargetLun;
private XenAdmin.Controls.SpinnerIcon spinnerIconAtScanTargetHostButton;
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanelError;
+ private System.Windows.Forms.PictureBox errorIconBottom;
+ private System.Windows.Forms.Label errorLabelBottom;
+ private System.Windows.Forms.PictureBox errorIconAtTargetLUN;
+ private System.Windows.Forms.Label errorLabelAtTargetLUN;
+ private System.Windows.Forms.PictureBox errorIconAtHostOrIP;
+ private System.Windows.Forms.Label errorLabelAtHostOrIP;
+ private System.Windows.Forms.PictureBox errorIconAtCHAPPassword;
+ private System.Windows.Forms.Label errorLabelAtCHAPPassword;
}
}
diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs
index 65521be86..3d892c767 100644
--- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs
+++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs
@@ -36,15 +36,14 @@ using XenAPI;
using XenAdmin.Actions;
using XenAdmin.Network;
using XenAdmin.Core;
-using System.Threading;
using XenAdmin.Controls;
using XenAdmin.Dialogs;
using System.Drawing;
using System.Linq;
-using System.Web.Script.Serialization;
-using XenAdmin.Utils;
+using XenAdmin.Dialogs.WarningDialogs;
using XenCenterLib;
+
namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
{
public partial class LVMoISCSI : XenTabPage
@@ -52,20 +51,33 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
///
- /// If an SR already exists on this LUN, this will point to the SR info which indicates that
- /// the SR should be reattached.
- ///
- /// If this is null, indicates the LUN should be formatted into a new SR.
+ /// Non-null value indicates an SR already existing on this LUN that should be reattached.
+ /// Null indicates the LUN should be formatted into a new SR.
///
private SR.SRInfo _srToIntroduce;
- private ISCSIPopulateLunsAction IscsiPopulateLunsAction;
- private ISCSIPopulateIQNsAction IscsiPopulateIqnsAction;
+ private ISCSIPopulateLunsAction _populateLunsAction;
+ private ISCSIPopulateIQNsAction _populateIqnsAction;
- private readonly Dictionary LunMap = new Dictionary();
+ private readonly Dictionary LunMap = new Dictionary();
- private readonly ToolTip TargetIqnToolTip = new ToolTip();
+ ///
+ /// Tooltip to show IQN value (as it can be very long)
+ ///
+ private readonly ToolTip toolTipTargetIqn = new ToolTip
+ {
+ Active = true,
+ AutomaticDelay = 0,
+ AutoPopDelay = 50000,
+ InitialDelay = 50,
+ ReshowDelay = 50,
+ ShowAlways = true
+ };
+ private bool _errorExists;
+ private bool _buttonNextEnabled;
+
+ private const string PROVIDER = "provider";
private const string TARGET = "target";
private const string PORT = "port";
private const string TARGETIQN = "targetIQN";
@@ -74,48 +86,20 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
private const string CHAPUSER = "chapuser";
private const string CHAPPASSWORD = "chappassword";
- private IEnumerable ErrorIcons
- {
- get { return new Control[] {errorIconAtCHAPPassword, errorIconAtHostOrIP, errorIconAtTargetLUN }; }
- }
-
- private IEnumerable ErrorLabels
- {
- get { return new Control[] { errorLabelAtHostname, errorLabelAtCHAPPassword, errorLabelAtTargetLUN }; }
- }
-
- private IEnumerable SpinnerControls
- {
- get { return new Control[] { spinnerIconAtScanTargetHostButton, spinnerIconAtTargetIqn, spinnerIconAtTargetLun }; }
- }
-
- private IEnumerable UserInputControls
- {
- get
- {
- return new Control[]
- {
- textBoxIscsiHost, textBoxIscsiPort, IscsiUseChapCheckBox, IScsiChapUserTextBox,
- IScsiChapSecretTextBox, scanTargetHostButton, comboBoxIscsiIqns, comboBoxIscsiLuns
- };
- }
- }
-
- private readonly TemporaryDisablerForControls controlDisabler = new TemporaryDisablerForControls();
-
public LVMoISCSI()
{
InitializeComponent();
SrType = SR.SRTypes.lvmoiscsi;
+ HideErrors();
}
#region XentabPage overrides
- public override string PageTitle { get { return Messages.NEWSR_PATH_ISCSI; } }
+ public override string PageTitle => Messages.NEWSR_PATH_ISCSI;
- public override string Text { get { return Messages.NEWSR_LOCATION; } }
+ public override string Text => Messages.NEWSR_LOCATION;
- public override string HelpID { get { return "Location_ISCSI"; } }
+ public override string HelpID => "Location_ISCSI";
protected override void PageLoadedCore(PageLoadedDirection direction)
{
@@ -130,11 +114,6 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
if (direction == PageLoadedDirection.Back)
return;
- // For Miami hosts we need to ensure an SR.probe()
- // has been performed, and that the user has made a decision. Show the iSCSI choices dialog until
- // they click something other than 'Cancel'. For earlier host versions, warn that data loss may
- // occur.
-
Host master = Helpers.GetMaster(Connection);
if (master == null)
{
@@ -142,52 +121,70 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
return;
}
- // Start probe
-
- List srs;
var currentSrType = SrType;
- if (!RunProbe(master, currentSrType, out srs))
+ if (!RunProbe(master, currentSrType, out var srs)) // start first probe
{
- cancel = iscsiProbeError = true;
+ cancel = true;
return;
}
- var performSecondProbe = Helpers.KolkataOrGreater(Connection) &&
- !Helpers.FeatureForbidden(Connection, Host.CorosyncDisabled);
+ var performSecondProbe = Helpers.KolkataOrGreater(Connection) && !Helpers.FeatureForbidden(Connection, Host.CorosyncDisabled);
+
if (performSecondProbe && srs.Count == 0)
{
- // Start second probe
currentSrType = SrType == SR.SRTypes.gfs2 ? SR.SRTypes.lvmoiscsi : SR.SRTypes.gfs2;
- if (!RunProbe(master, currentSrType, out srs))
+ if (!RunProbe(master, currentSrType, out srs)) // start second probe
{
- cancel = iscsiProbeError = true;
+ cancel = true;
return;
}
}
// Probe has been performed. Now ask the user if they want to Reattach/Format/Cancel.
// Will return false on cancel
- cancel = iscsiProbeError = !ExamineIscsiProbeResults(currentSrType, srs);
+ cancel = !ExamineIscsiProbeResults(currentSrType, srs);
}
+ public override void PageCancelled(ref bool cancel)
+ {
+ _populateIqnsAction?.Cancel();
+ _populateLunsAction?.Cancel();
+ }
+
+ public override bool EnableNext()
+ {
+ return _buttonNextEnabled;
+ }
+
+ public override bool EnablePrevious()
+ {
+ if (SrWizardType.DisasterRecoveryTask && SrWizardType.SrToReattach == null)
+ return false;
+
+ return _populateIqnsAction == null && _populateLunsAction == null;
+ }
+
+ public override void PopulatePage()
+ {
+ HideErrors();
+ }
+
+ #endregion
+
private bool RunProbe(Host master, SR.SRTypes srType, out List srs)
{
srs = null;
- Dictionary dconf = GetDeviceConfig(srType);
+ var dconf = GetDeviceConfig(srType);
if (dconf == null)
return false;
var action = new SrProbeAction(Connection, master, srType, dconf);
- using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee))
- {
- dialog.ShowCancel = true;
+ using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee) {ShowCancel = true})
dialog.ShowDialog(this);
- }
- _srToIntroduce = null;
if (action.Succeeded)
{
try
@@ -201,188 +198,394 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
}
}
- Exception exn = action.Exception;
- log.Warn(exn, exn);
-
- Failure failure = exn as Failure;
- if (failure != null)
- {
- errorIconAtHostOrIP.Visible = true;
- errorLabelAtHostname.Visible = true;
-
- errorLabelAtHostname.Text = failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_140"
- ? Messages.INVALID_HOST
- : (failure.ErrorDescription.Count > 2
- ? failure.ErrorDescription[2]
- : failure.ErrorDescription[0]);
-
- textBoxIscsiHost.Focus();
- }
+ HandleFailure(action);
return false;
}
- bool iscsiProbeError = false;
- public override bool EnableNext()
- {
- UInt16 i;
- bool portValid = UInt16.TryParse(textBoxIscsiPort.Text, out i);
-
- return !String.IsNullOrEmpty(getIscsiHost())
- && portValid
- && !(IscsiUseChapCheckBox.Checked && String.IsNullOrEmpty(IScsiChapUserTextBox.Text))
- && comboBoxIscsiLuns.SelectedItem != null && comboBoxIscsiLuns.SelectedItem as string != Messages.SELECT_TARGET_LUN
- && !iscsiProbeError && !IsLunInUse();
- }
-
- public override bool EnablePrevious()
- {
- if (SrWizardType.DisasterRecoveryTask && SrWizardType.SrToReattach == null)
- return false;
-
- return true;
- }
-
- public override void PopulatePage()
- {
- HideAllErrorIconsAndLabels();
-
- // Enable IQN scanning
- comboBoxIscsiIqns.Visible = true;
-
- // IQN's can be very long, so we will show the value as a mouse over tooltip.
- // Initialize the tooltip here.
- TargetIqnToolTip.Active = true;
- TargetIqnToolTip.AutomaticDelay = 0;
- TargetIqnToolTip.AutoPopDelay = 50000;
- TargetIqnToolTip.InitialDelay = 50;
- TargetIqnToolTip.ReshowDelay = 50;
- TargetIqnToolTip.ShowAlways = true;
- }
-
- #endregion
-
private void UpdateButtons()
{
- UInt16 i;
- bool portValid = UInt16.TryParse(textBoxIscsiPort.Text, out i);
+ bool portValid = ushort.TryParse(textBoxIscsiPort.Text, out _);
+ var iscsiHost = getIscsiHost();
+ bool validChap = !checkBoxUseChap.Checked || !string.IsNullOrEmpty(textBoxChapUser.Text);
- scanTargetHostButton.Enabled =
- !String.IsNullOrEmpty(getIscsiHost())
- && portValid;
+ buttonScanTargetHost.Enabled = !string.IsNullOrEmpty(iscsiHost) && portValid && validChap &&
+ _populateIqnsAction == null && _populateLunsAction == null;
+
+ _buttonNextEnabled = !string.IsNullOrEmpty(iscsiHost) && portValid && validChap &&
+ !string.IsNullOrEmpty(getIscsiLUN()) && !_errorExists;
- // Cause wizards next etc to update
OnPageUpdated();
}
- private void textBoxIscsiHost_TextChanged(object sender, EventArgs e)
+ private string getIscsiHost()
{
- HideAllErrorIconsAndLabels();
- HideAllSpinnerIcons();
- IScsiParams_TextChanged(null, null);
+ // If the user has selected an IQN, use the host from that IQN (due to multi-homing,
+ // this may differ from the host they first entered). Otherwise use the host
+ // they first entered
+
+ if (comboBoxIscsiIqns.SelectedItem is ToStringWrapper wrapper)
+ return wrapper.item.IpAddress;
+ return textBoxIscsiHost.Text.Trim();
}
- ///
- /// Called when any of the iSCSI filer params change: resets the IQNs/LUNs.
- /// Must be called on the event thread.
- ///
- private void IScsiParams_TextChanged(object sender, EventArgs e)
+ private ushort getIscsiPort()
{
- Program.AssertOnEventThread();
+ if (comboBoxIscsiIqns.SelectedItem is ToStringWrapper wrapper)
+ return wrapper.item.Port;
- spinnerIconAtScanTargetHostButton.Visible = false;
+ if (ushort.TryParse(textBoxIscsiPort.Text, out var port))
+ return port;
+
+ return Util.DEFAULT_ISCSI_PORT;
+ }
+
+ private string getIscsiIQN()
+ {
+ if (comboBoxIscsiIqns.SelectedItem is ToStringWrapper wrapper)
+ return wrapper.item.TargetIQN;
+
+ return "";
+ }
+
+ private string getIscsiLUN()
+ {
+ var text = comboBoxIscsiLuns.SelectedItem as string;
+ return text == null || text == Messages.SELECT_TARGET_LUN ? "" : text;
+ }
+
+ private void ShowError(PictureBox errorIcon, Label errorLabel, string errorMessage)
+ {
+ _errorExists = true;
+ errorLabel.Text = errorMessage;
+ errorIcon.Visible = true;
+ errorLabel.Visible = true;
+ }
+
+ private void HideErrors()
+ {
+ _errorExists = false;
+ errorIconAtHostOrIP.Visible = false;
+ errorIconAtCHAPPassword.Visible = false;
+ errorIconAtTargetLUN.Visible = false;
+ errorIconBottom.Visible = false;
+ errorLabelAtHostOrIP.Visible = false;
+ errorLabelAtCHAPPassword.Visible = false;
+ errorLabelAtTargetLUN.Visible = false;
+ errorLabelBottom.Visible = false;
+ }
+
+ private void ResetIqns()
+ {
+ spinnerIconAtTargetIqn.StopSpinning();
+ try
+ {
+ comboBoxIscsiIqns.SelectedIndexChanged -= comboBoxIscsiIqns_SelectedIndexChanged;
+ comboBoxIscsiIqns.Items.Clear();
+ }
+ finally
+ {
+ comboBoxIscsiIqns.SelectedIndexChanged += comboBoxIscsiIqns_SelectedIndexChanged;
+ }
- // User has changed filer hostname/username/password - clear IQN/LUN boxes
- comboBoxIscsiIqns.Items.Clear();
comboBoxIscsiIqns.Enabled = false;
- labelIscsiIQN.Enabled = false;
+ labelTargetIqn.Enabled = false;
+ toolTipTargetIqn.SetToolTip(comboBoxIscsiIqns, null);
+ }
+
+ private void ResetLuns()
+ {
+ spinnerIconAtTargetLun.StopSpinning();
+ try
+ {
+ comboBoxIscsiLuns.SelectedIndexChanged -= comboBoxIscsiLuns_SelectedIndexChanged;
+ comboBoxIscsiLuns.Items.Clear();
+ }
+ finally
+ {
+ comboBoxIscsiLuns.SelectedIndexChanged += comboBoxIscsiLuns_SelectedIndexChanged;
+ }
+
+ comboBoxIscsiLuns.Enabled = false;
+ labelTargetLun.Enabled = false;
+ LunMap.Clear();
+ }
+
+ private void ResetAll()
+ {
+ spinnerIconAtScanTargetHostButton.StopSpinning();
iSCSITargetGroupBox.Enabled = false;
- // Cancel pending IQN/LUN scans
- if (IscsiPopulateIqnsAction != null)
- {
- IscsiPopulateIqnsAction.Cancel();
- }
-
- ChapSettings_Changed(null, null);
+ HideErrors();
+ ResetIqns();
+ ResetLuns();
+ UpdateButtons();
}
- private bool IsLunInUse()
+ private void DisableAllInputControls()
{
- SR sr = UniquenessCheck();
+ textBoxIscsiHost.Enabled = false;
+ textBoxIscsiPort.Enabled = false;
+ checkBoxUseChap.Enabled = false;
+ textBoxChapUser.Enabled = false;
+ textBoxChapPassword.Enabled = false;
+ iSCSITargetGroupBox.Enabled = false;
+ }
- // LUN is not in use iff sr != null
+ private void EnableInputControls()
+ {
+ textBoxIscsiHost.Enabled = true;
+ textBoxIscsiPort.Enabled = true;
+ checkBoxUseChap.Enabled = true;
+ EnableChapControls();
+ iSCSITargetGroupBox.Enabled = true;
+ }
- if (sr == null)
+ private void EnableChapControls()
+ {
+ bool enabled = checkBoxUseChap.Checked;
+ textBoxChapUser.Enabled = enabled;
+ textBoxChapPassword.Enabled = enabled;
+ labelCHAPuser.Enabled = enabled;
+ IScsiChapSecretLabel.Enabled = enabled;
+ }
+
+ private void HandleFailure(ActionBase action)
+ {
+ if (action == null || !(action.Exception is Failure failure) || failure.ErrorDescription.Count < 1)
+ return;
+
+ if (failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_68")
{
- HideAllErrorIconsAndLabels();
- return false;
+ ShowError(errorIconAtCHAPPassword, errorLabelAtCHAPPassword, Messages.LOGGING_IN_TO_THE_ISCSI_TARGET_FAILED);
+ textBoxChapUser.Focus();
+ }
+ else if (failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_140")
+ {
+ ShowError(errorIconAtHostOrIP, errorLabelAtHostOrIP, Messages.INVALID_HOST);
+ textBoxIscsiHost.Focus();
+ }
+ else if (failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_141")
+ {
+ ShowError(errorIconAtHostOrIP, errorLabelAtHostOrIP, Messages.SR_UNABLE_TO_CONNECT_TO_SCSI_TARGET);
+ textBoxIscsiHost.Focus();
+ }
+ else
+ ShowError(errorIconBottom, errorLabelBottom, failure.Message);
+ }
+
+ #region Event handlers
+
+ private void textBoxIscsiHost_TextChanged(object sender, EventArgs e)
+ {
+ ResetAll();
+ }
+
+ private void checkBoxUseChap_CheckedChanged(object sender, EventArgs e)
+ {
+ EnableChapControls();
+ ResetAll();
+ }
+
+ private void textBoxChapPassword_TextChanged(object sender, EventArgs e)
+ {
+ ResetAll();
+ }
+
+ private void textBoxChapUser_TextChanged(object sender, EventArgs e)
+ {
+ ResetAll();
+ }
+
+ private void buttonScanTargetHost_Click(object sender, EventArgs e)
+ {
+ HideErrors();
+ ResetIqns();
+ ResetLuns();
+
+ DisableAllInputControls();
+ spinnerIconAtScanTargetHostButton.StartSpinning();
+
+ _populateIqnsAction = SrType == SR.SRTypes.gfs2
+ ? new Gfs2PopulateIQNsAction(Connection, getIscsiHost(), getIscsiPort(), ChapUser, ChapPassword)
+ : new ISCSIPopulateIQNsAction(Connection, getIscsiHost(), getIscsiPort(), ChapUser, ChapPassword);
+
+ _populateIqnsAction.Completed += PopulateIqnsAction_Completed;
+ _populateIqnsAction.RunAsync();
+ UpdateButtons();
+ }
+
+ private void comboBoxIscsiIqns_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ HideErrors();
+ ResetLuns();
+
+ if (comboBoxIscsiIqns.SelectedItem is ToStringWrapper wrapper)
+ {
+ toolTipTargetIqn.SetToolTip(comboBoxIscsiIqns, wrapper.ToString());
+ DisableAllInputControls();
+ spinnerIconAtTargetIqn.StartSpinning();
+
+ _populateLunsAction = SrType == SR.SRTypes.gfs2
+ ? new Gfs2PopulateLunsAction(Connection, getIscsiHost(), getIscsiPort(), getIscsiIQN(), ChapUser, ChapPassword)
+ : new ISCSIPopulateLunsAction(Connection, getIscsiHost(), getIscsiPort(), getIscsiIQN(), ChapUser, ChapPassword);
+
+ _populateLunsAction.Completed += PopulateLunsAction_Completed;
+ _populateLunsAction.RunAsync();
+ }
+ else
+ {
+ toolTipTargetIqn.SetToolTip(comboBoxIscsiIqns, Messages.SELECT_TARGET_IQN);
}
- spinnerIconAtTargetLun.Visible = false;
-
- Pool pool = Helpers.GetPool(sr.Connection);
- if (pool != null)
- {
- errorIconAtTargetLUN.Visible = true;
- errorLabelAtTargetLUN.Visible = true;
- errorLabelAtTargetLUN.Text = String.Format(Messages.NEWSR_LUN_IN_USE_ON_POOL, sr.Name(), pool.Name());
- return true;
- }
-
- Host master = Helpers.GetMaster(sr.Connection);
- if (master != null)
- {
- errorIconAtTargetLUN.Visible = true;
- errorLabelAtTargetLUN.Visible = true;
- errorLabelAtTargetLUN.Text = String.Format(Messages.NEWSR_LUN_IN_USE_ON_SERVER, sr.Name(), master.Name());
- return true;
- }
-
- errorIconAtTargetLUN.Visible = true;
- errorLabelAtTargetLUN.Visible = true;
- errorLabelAtTargetLUN.Text = Messages.NEWSR_LUN_IN_USE;
- return true;
+ UpdateButtons();
}
private void comboBoxIscsiLuns_SelectedIndexChanged(object sender, EventArgs e)
{
- iscsiProbeError = false;
- if (comboBoxIscsiLuns.SelectedItem as string != Messages.SELECT_TARGET_LUN)
+ if (comboBoxIscsiLuns.SelectedItem as string == Messages.SELECT_TARGET_LUN)
{
- spinnerIconAtTargetLun.ShowSuccessImage();
+ spinnerIconAtTargetLun.StopSpinning();
+ HideErrors();
}
else
{
- spinnerIconAtTargetLun.Visible = false;
- HideAllErrorIconsAndLabels();
+ spinnerIconAtTargetLun.ShowSuccessImage();
+ var isLunInUse = SrUsingLunExists(out var sr);//in this or other connected pools
+
+ if (isLunInUse)
+ ShowError(errorIconAtTargetLUN, errorLabelAtTargetLUN, LVMoIsciWarningDialog.GetSrInUseMessage(sr));
+ else
+ HideErrors();
}
UpdateButtons();
}
- private void ChapSettings_Changed(object sender, EventArgs e)
- {
- comboBoxIscsiLuns.Items.Clear();
- comboBoxIscsiLuns.Text = "";
- comboBoxIscsiLuns.Enabled = false;
- targetLunLabel.Enabled = false;
- if (IscsiPopulateLunsAction != null)
+ private void PopulateIqnsAction_Completed(ActionBase sender)
+ {
+ Program.Invoke(this, () => PopulateIqnsAction_Completed_(sender as ISCSIPopulateIQNsAction));
+ }
+
+ private void PopulateIqnsAction_Completed_(ISCSIPopulateIQNsAction action)
+ {
+ if (action == null)
+ return;
+
+ Program.AssertOnEventThread();
+
+ _populateIqnsAction = null;
+ EnableInputControls();
+
+ if (!action.Succeeded)
{
- IscsiPopulateLunsAction.Cancel();
+ spinnerIconAtScanTargetHostButton.StopSpinning();
+ HandleFailure(action);
+ UpdateButtons();
+ return;
}
+ // If no IQNs are found do nothing; the ActionProgressDialog will have shown Messages.NEWSR_NO_IQNS_FOUND
+ var validIqns = action.IQNs.Where(info => !string.IsNullOrEmpty(info.TargetIQN)).ToList();
+ if (validIqns.Count == 0)
+ {
+ UpdateButtons();
+ return;
+ }
+
+ int width = comboBoxIscsiIqns.Width;
+
+ comboBoxIscsiIqns.Items.Add(Messages.SELECT_TARGET_IQN);
+
+ foreach (IScsiIqnInfo iqnInfo in validIqns)
+ {
+ var toString = string.Format("{0} ({1}:{2})", iqnInfo.TargetIQN, iqnInfo.IpAddress, iqnInfo.Port);
+ comboBoxIscsiIqns.Items.Add(new ToStringWrapper(iqnInfo, toString));
+ width = Math.Max(width, Drawing.MeasureText(toString, comboBoxIscsiIqns.Font).Width);
+ }
+
+ // Set the combo box dropdown width to accommodate the widest item (within reason)
+ comboBoxIscsiIqns.DropDownWidth = Math.Min(width, Int16.MaxValue);
+
+ comboBoxIscsiIqns.SelectedItem = comboBoxIscsiIqns.Items.Count == 2
+ ? comboBoxIscsiIqns.Items[1]
+ : Messages.SELECT_TARGET_IQN;
+
+ labelTargetIqn.Enabled = true;
+ comboBoxIscsiIqns.Enabled = true;
+ comboBoxIscsiIqns.Focus();
+ spinnerIconAtScanTargetHostButton.ShowSuccessImage();
UpdateButtons();
}
- ///
- /// Check the current config of the iSCSI sr in the wizard is unique across
- /// all active connections.
- ///
- /// SR that uses this config if not unique, null if unique
- private SR UniquenessCheck()
+ private void PopulateLunsAction_Completed(ActionBase sender)
{
- // Check currently selected lun is unique amongst other connected hosts.
+ Program.Invoke(this, () => PopulateLunsAction_Completed_(sender as ISCSIPopulateLunsAction));
+ }
+
+ private void PopulateLunsAction_Completed_(ISCSIPopulateLunsAction action)
+ {
+ if (action == null)
+ return;
+
+ Program.AssertOnEventThread();
+
+ _populateLunsAction = null;
+ EnableInputControls();
+
+ if (!action.Succeeded)
+ {
+ spinnerIconAtTargetIqn.StopSpinning();
+ HandleFailure(action);
+ UpdateButtons();
+ return;
+ }
+
+ // If no IQNs are found do nothing; the ActionProgressDialog will have shown Messages.NEWSR_NO_LUNS_FOUND
+ if (action.LUNs.Length == 0)
+ {
+ UpdateButtons();
+ return;
+ }
+
+ comboBoxIscsiLuns.Items.Add(Messages.SELECT_TARGET_LUN);
+
+ foreach (ISCSIInfo i in action.LUNs)
+ {
+ string label = "LUN";
+ if (i.LunID != -1)
+ label += string.Format(" {0}", i.LunID);
+ if (i.Serial != "")
+ label += string.Format(": {0}", i.Serial);
+ if (i.Size >= 0)
+ label += string.Format(": {0}", Util.DiskSizeString(i.Size));
+ if (i.Vendor != "")
+ label += string.Format(" ({0})", i.Vendor);
+ comboBoxIscsiLuns.Items.Add(label);
+ LunMap.Add(label, i);
+ }
+
+ //if there is only one choice, select that one by default
+ comboBoxIscsiLuns.SelectedItem = comboBoxIscsiLuns.Items.Count == 2
+ ? comboBoxIscsiLuns.Items[1]
+ : Messages.SELECT_TARGET_LUN;
+
+ labelTargetLun.Enabled = true;
+ comboBoxIscsiLuns.Enabled = true;
+ comboBoxIscsiLuns.Focus();
+ spinnerIconAtTargetIqn.ShowSuccessImage();
+ UpdateButtons();
+ }
+
+ #endregion
+
+ private bool SrUsingLunExists(out SR theSr)
+ {
+ theSr = null;
+
+ if (string.IsNullOrEmpty(getIscsiLUN()))
+ return false;
+
foreach (IXenConnection connection in ConnectionsManager.XenConnectionsCopy)
{
foreach (SR sr in connection.Cache.SRs)
@@ -398,366 +601,19 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
if (pbd == null)
continue;
- if (UniquenessCheckMiami(connection, pbd))
- return sr;
- }
- }
-
- return null;
- }
-
- ///
- /// Check currently LUN against miami host
- ///
- ///
- ///
- ///
- private bool UniquenessCheckMiami(IXenConnection connection, PBD pbd)
- {
- String scsiID;
-
- if (pbd.device_config.ContainsKey(SCSIID))
- scsiID = pbd.device_config[SCSIID];
- else
- return false;
-
- String myLUN = getIscsiLUN();
-
- if (!LunMap.ContainsKey(myLUN))
- return false;
-
- ISCSIInfo info = LunMap[myLUN];
-
- return info.ScsiID == scsiID;
- }
-
- private String getIscsiHost()
- {
- // If the user has selected an IQN, use the host from that IQN (due to multi-homing,
- // this may differ from the host they first entered). Otherwise use the host
- // they first entered,
- ToStringWrapper wrapper = comboBoxIscsiIqns.SelectedItem as ToStringWrapper;
- if (wrapper != null)
- return wrapper.item.IpAddress;
- return textBoxIscsiHost.Text.Trim();
- }
-
- private UInt16 getIscsiPort()
- {
- ToStringWrapper wrapper = comboBoxIscsiIqns.SelectedItem as ToStringWrapper;
- if (wrapper != null)
- return wrapper.item.Port;
-
- // No combobox item was selected
- UInt16 port;
- if (UInt16.TryParse(textBoxIscsiPort.Text, out port))
- {
- return port;
- }
- else
- {
- return Util.DEFAULT_ISCSI_PORT;
- }
- }
-
- private String getIscsiIQN()
- {
- ToStringWrapper wrapper = comboBoxIscsiIqns.SelectedItem as ToStringWrapper;
- if (wrapper == null)
- return "";
- else
- return wrapper.item.TargetIQN;
- }
-
- private void IScsiTargetIqnComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- ToStringWrapper wrapper = comboBoxIscsiIqns.SelectedItem as ToStringWrapper;
-
- ClearLunMapAndCombo();
- HideAllErrorIconsAndLabels();
-
- if (wrapper != null)
- {
- TargetIqnToolTip.SetToolTip(comboBoxIscsiIqns, wrapper.ToString());
- IscsiPopulateLUNs();
- }
- else
- {
- TargetIqnToolTip.SetToolTip(comboBoxIscsiIqns, Messages.SELECT_TARGET_IQN);
- }
- }
-
- private String getIscsiLUN()
- {
- return comboBoxIscsiLuns.Text;
- }
-
- private void IscsiUseChapCheckBox_CheckedChanged(object sender, EventArgs e)
- {
- bool enabled = IscsiUseChapCheckBox.Checked;
-
- IScsiChapUserTextBox.Enabled = enabled;
- IScsiChapSecretTextBox.Enabled = enabled;
- labelCHAPuser.Enabled = enabled;
- IScsiChapSecretLabel.Enabled = enabled;
-
- HideAllErrorIconsAndLabels();
- ChapSettings_Changed(null, null);
- }
-
- private void scanTargetHostButton_Click(object sender, EventArgs e)
- {
- HideAllErrorIconsAndLabels();
- spinnerIconAtTargetIqn.Visible = false;
- spinnerIconAtTargetLun.Visible = false;
-
- spinnerIconAtScanTargetHostButton.StartSpinning();
-
- scanTargetHostButton.Enabled = false;
- // For this button to be enabled, we must be Miami or newer
- comboBoxIscsiIqns.Items.Clear();
- // Clear LUNs as they may no longer be valid
- ClearLunMapAndCombo();
- // Cancel any LUN scan in progress, as it is no longer meaningful
- if (IscsiPopulateLunsAction != null)
- {
- IscsiPopulateLunsAction.Cancel();
- }
-
- UpdateButtons();
-
- var chapUser = IscsiUseChapCheckBox.Checked ? IScsiChapUserTextBox.Text : null;
- var chapPwd = IscsiUseChapCheckBox.Checked ? IScsiChapSecretTextBox.Text : null;
-
- IscsiPopulateIqnsAction = SrType == SR.SRTypes.gfs2
- ? new Gfs2PopulateIQNsAction(Connection, getIscsiHost(), getIscsiPort(), chapUser, chapPwd)
- : new ISCSIPopulateIQNsAction(Connection, getIscsiHost(), getIscsiPort(), chapUser, chapPwd);
-
- IscsiPopulateIqnsAction.Completed += IscsiPopulateIqnsAction_Completed;
-
- controlDisabler.Reset();
- controlDisabler.SaveOrUpdateEnabledStates(UserInputControls);
- controlDisabler.DisableAllControls();
-
- scanTargetHostButton.Enabled = false;
- IscsiPopulateIqnsAction.RunAsync();
- }
-
- private void ClearLunMapAndCombo()
- {
- // Clear LUNs as they may no longer be valid
- comboBoxIscsiLuns.Items.Clear();
- comboBoxIscsiLuns.Text = "";
- comboBoxIscsiLuns.Enabled = false;
- targetLunLabel.Enabled = false;
- LunMap.Clear();
- spinnerIconAtTargetIqn.Visible = false;
- spinnerIconAtTargetLun.Visible = false;
-
- UpdateButtons();
- }
-
- private void IscsiPopulateIqnsAction_Completed(ActionBase sender)
- {
- Program.Invoke(this, (System.Threading.WaitCallback)IscsiPopulateIqnsAction_Completed_, sender);
- }
-
- private void IscsiPopulateIqnsAction_Completed_(object o)
- {
- Program.AssertOnEventThread();
- ISCSIPopulateIQNsAction action = (ISCSIPopulateIQNsAction)o;
-
- controlDisabler.RestoreEnabledOnAllControls();
-
- if (action.Succeeded)
- {
- if (action.IQNs.Length == 0)
- {
- // Do nothing: ActionProgressDialog will show Messages.NEWSR_NO_IQNS_FOUND
- }
- else
- {
- int width = comboBoxIscsiIqns.Width;
-
- comboBoxIscsiIqns.Items.Add(Messages.SELECT_TARGET_IQN);
-
- foreach (Actions.IScsiIqnInfo iqnInfo in action.IQNs)
+ if (pbd.device_config.TryGetValue(SCSIID, out var scsiId) &&
+ LunMap.TryGetValue(getIscsiLUN(), out var info) &&
+ info.ScsiID == scsiId)
{
- if (!String.IsNullOrEmpty(iqnInfo.TargetIQN))
- {
- String toString = String.Format("{0} ({1}:{2})", iqnInfo.TargetIQN, iqnInfo.IpAddress, iqnInfo.Port);
- comboBoxIscsiIqns.Items.Add(new ToStringWrapper(iqnInfo, toString));
- width = Math.Max(width, Drawing.MeasureText(toString, comboBoxIscsiIqns.Font).Width);
- }
- }
- // Set the combo box dropdown width to accommodate the widest item (within reason)
- comboBoxIscsiIqns.DropDownWidth = Math.Min(width, Int16.MaxValue);
-
- if (comboBoxIscsiIqns.Items.Count > 0)
- {
- comboBoxIscsiIqns.SelectedItem = Messages.SELECT_TARGET_IQN;
- comboBoxIscsiIqns.Enabled = true;
- labelIscsiIQN.Enabled = true;
- iSCSITargetGroupBox.Enabled = true;
- }
-
- spinnerIconAtScanTargetHostButton.ShowSuccessImage();
-
- comboBoxIscsiIqns.Focus();
- }
- }
- else
- {
- spinnerIconAtScanTargetHostButton.Visible = false;
-
- Failure failure = action.Exception as Failure;
- if (failure != null && failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_140")
- {
- errorIconAtHostOrIP.Visible = true;
- errorLabelAtHostname.Text = Messages.INVALID_HOST;
- errorLabelAtHostname.Visible = true;
- textBoxIscsiHost.Focus();
- }
- else if (failure != null && failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_141")
- {
- errorIconAtHostOrIP.Visible = true;
- errorLabelAtHostname.Text = Messages.SR_UNABLE_TO_CONNECT_TO_SCSI_TARGET;
- errorLabelAtHostname.Visible = true;
- textBoxIscsiHost.Focus();
- }
- else if (failure != null && failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_68")
- {
- errorIconAtHostOrIP.Visible = true;
- errorLabelAtHostname.Text = Messages.LOGGING_IN_TO_THE_ISCSI_TARGET_FAILED;
- errorLabelAtHostname.Visible = true;
- textBoxIscsiHost.Focus();
- }
- else
- {
- errorIconAtHostOrIP.Visible = true;
- errorLabelAtHostname.Text = failure.ErrorDescription.Count > 2 ? failure.ErrorDescription[2] : failure.ErrorDescription[0];
- errorLabelAtHostname.Visible = true;
- textBoxIscsiHost.Focus();
-
- }
- }
- scanTargetHostButton.Enabled = true;
- }
-
- private void IscsiPopulateLUNs()
- {
- spinnerIconAtTargetIqn.StartSpinning();
-
- comboBoxIscsiLuns.Items.Clear();
- LunMap.Clear();
-
- var chapUser = IscsiUseChapCheckBox.Checked ? IScsiChapUserTextBox.Text : null;
- var chapPwd = IscsiUseChapCheckBox.Checked ? IScsiChapSecretTextBox.Text : null;
-
- IscsiPopulateLunsAction = SrType == SR.SRTypes.gfs2
- ? new Gfs2PopulateLunsAction(Connection, getIscsiHost(), getIscsiPort(), getIscsiIQN(), chapUser, chapPwd)
- : new ISCSIPopulateLunsAction(Connection, getIscsiHost(), getIscsiPort(), getIscsiIQN(), chapUser, chapPwd);
-
- IscsiPopulateLunsAction.Completed += IscsiPopulateLunsAction_Completed;
-
- controlDisabler.Reset();
- controlDisabler.SaveOrUpdateEnabledStates(UserInputControls);
- controlDisabler.DisableAllControls();
-
- IscsiPopulateLunsAction.RunAsync();
- }
-
- private void IscsiPopulateLunsAction_Completed(ActionBase sender)
- {
- Program.Invoke(this, (WaitCallback)IscsiPopulateLunsAction_Completed_, sender);
- }
-
- private void IscsiPopulateLunsAction_Completed_(object o)
- {
- Program.AssertOnEventThread();
-
- controlDisabler.RestoreEnabledOnAllControls();
-
- ISCSIPopulateLunsAction action = (ISCSIPopulateLunsAction)o;
-
- if (!action.Succeeded)
- {
- spinnerIconAtTargetIqn.Visible = false;
-
- Failure failure = action.Exception as Failure;
-
- if (failure != null && failure.ErrorDescription != null && failure.ErrorDescription.Count > 0)
- {
- if (failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_140")
- {
- errorIconAtHostOrIP.Visible = true;
- errorLabelAtHostname.Text = Messages.INVALID_HOST;
- errorLabelAtHostname.Visible = true;
- textBoxIscsiHost.Focus();
- }
- else if (failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_68")
- {
- errorIconAtCHAPPassword.Visible = true;
- errorLabelAtCHAPPassword.Text = Messages.LOGGING_IN_TO_THE_ISCSI_TARGET_FAILED;
- errorLabelAtCHAPPassword.Visible = true;
- IScsiChapUserTextBox.Focus();
- }
- else
- {
- errorIconAtTargetLUN.Visible = true;
- errorIconAtTargetLUN.Text = failure.ErrorDescription.Count > 2 ? failure.ErrorDescription[2] : failure.ErrorDescription[0];
- errorIconAtTargetLUN.Visible = true;
- textBoxIscsiHost.Focus();
+ theSr = sr;
+ return true;
}
}
- return;
}
- if (action.LUNs.Length == 0)
- {
- // Do nothing: ActionProgressDialog will show Messages.NEWSR_NO_LUNS_FOUND
- }
- else
- {
- comboBoxIscsiLuns.Items.Add(Messages.SELECT_TARGET_LUN);
-
- foreach (Actions.ISCSIInfo i in action.LUNs)
- {
- String label = "LUN";
- if (i.LunID != -1)
- label += String.Format(" {0}", i.LunID);
- if (i.Serial != "")
- label += String.Format(": {0}", i.Serial);
- if (i.Size >= 0)
- label += String.Format(": {0}", Util.DiskSizeString(i.Size));
- if (i.Vendor != "")
- label += String.Format(" ({0})", i.Vendor);
- comboBoxIscsiLuns.Items.Add(label);
- LunMap.Add(label, i);
- }
- comboBoxIscsiLuns.SelectedItem = comboBoxIscsiLuns.Items.Count == 2 ? comboBoxIscsiLuns.Items[1] : Messages.SELECT_TARGET_LUN; //if there is only one choice, select that one by default
- comboBoxIscsiLuns.Enabled = true;
- targetLunLabel.Enabled = true;
- comboBoxIscsiLuns.Focus();
-
- spinnerIconAtTargetIqn.ShowSuccessImage();
- }
-
- comboBoxIscsiLuns.Enabled = true;
- comboBoxIscsiIqns.Enabled = true;
-
- UpdateButtons();
+ return false;
}
- ///
- /// Called with the results of an iSCSI SR.probe(), either immediately after the scan, or after the
- /// user has performed a scan, clicked 'cancel' on a dialog, and then clicked 'next' again (this
- /// avoids duplicate probing if none of the settings have changed).
- ///
- ///
- /// Whether to continue or not - wheter to format or not is stored in
- /// iScsiFormatLUN.
- ///
private bool ExamineIscsiProbeResults(SR.SRTypes currentSrType, List srs)
{
_srToIntroduce = null;
@@ -765,9 +621,12 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
if (srs == null)
return false;
+ // There should be 0 or 1 SRs on the LUN
+ System.Diagnostics.Debug.Assert(srs.Count == 0 || srs.Count == 1);
+
try
{
- if (!String.IsNullOrEmpty(SrWizardType.UUID))
+ if (!string.IsNullOrEmpty(SrWizardType.UUID))
{
// Check LUN contains correct SR
if (srs.Count == 1 && srs[0].UUID == SrWizardType.UUID)
@@ -777,15 +636,12 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
return true;
}
- errorIconAtTargetLUN.Visible = true;
- errorLabelAtTargetLUN.Visible = true;
- errorLabelAtTargetLUN.Text = String.Format(Messages.INCORRECT_LUN_FOR_SR, SrWizardType.SrName);
-
+ ShowError(errorIconAtTargetLUN, errorLabelAtTargetLUN, string.Format(Messages.INCORRECT_LUN_FOR_SR, SrWizardType.SrName));
return false;
}
- else if (srs.Count == 0)
+
+ if (srs.Count == 0)
{
- // No existing SRs were found on this LUN. If allowed to create new SR, ask the user if they want to proceed and format.
if (!SrWizardType.AllowToCreateNewSr)
{
using (var dlg = new ErrorDialog(Messages.NEWSR_LUN_HAS_NO_SRS))
@@ -793,64 +649,36 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
return false;
}
- DialogResult result = DialogResult.Yes;
- if (!Program.RunInAutomatedTestMode)
- {
- using (var dlg = new WarningDialog(Messages.NEWSR_ISCSI_FORMAT_WARNING,
- ThreeButtonDialog.ButtonYes,
- new ThreeButtonDialog.TBDButton(Messages.NO_BUTTON_CAPTION, DialogResult.No, selected: true))
- {WindowTitle = Text})
- {
- result = dlg.ShowDialog(this);
- }
- }
- return result == DialogResult.Yes;
- }
- else
- {
- // There should be 0 or 1 SRs on the LUN
- System.Diagnostics.Trace.Assert(srs.Count == 1);
-
- // CA-17230
- // Check this isn't a detached SR
- SR.SRInfo info = srs[0];
- SR sr = SrWizardHelpers.SrInUse(info.UUID);
- if (sr != null)
- {
- DialogResult res;
- using (var d = new NoIconDialog(string.Format(Messages.DETACHED_ISCI_DETECTED, Helpers.GetName(sr.Connection)),
- new ThreeButtonDialog.TBDButton(Messages.ATTACH_SR, DialogResult.OK),
- ThreeButtonDialog.ButtonCancel))
- {
- res = d.ShowDialog(Program.MainWindow);
- }
-
- if (res == DialogResult.Cancel)
- return false;
-
- _srToIntroduce = info;
- SrType = currentSrType; // the type of the existing SR
+ if (Program.RunInAutomatedTestMode)
return true;
- }
- // An SR exists on this LUN. Ask the user if they want to attach it, format it and
- // create a new SR, or cancel.
- DialogResult result = Program.RunInAutomatedTestMode ? DialogResult.Yes :
- new IscsiChoicesDialog(Connection, info, currentSrType, SrType).ShowDialog(this);
-
- switch (result)
+ // SR creation is allowed; ask the user if they want to proceed and format.
+ using (var dlog = new LVMoIsciWarningDialog(Connection, null, currentSrType, SrType))
{
- case DialogResult.Yes:
- // Reattach
- _srToIntroduce = srs[0];
+ dlog.ShowDialog(this);
+ return dlog.SelectedOption == LVMoHBAWarningDialog.UserSelectedOption.Format;
+ }
+ }
+
+ if (Program.RunInAutomatedTestMode)
+ return true;
+
+ // offer to attach it, or format it to create a new SR, or cancel
+ SR.SRInfo srInfo = srs[0];
+
+ using (var dlog = new LVMoIsciWarningDialog(Connection, srInfo, currentSrType, SrType))
+ {
+ dlog.ShowDialog(this);
+
+ switch (dlog.SelectedOption)
+ {
+ case LVMoHBAWarningDialog.UserSelectedOption.Reattach:
+ _srToIntroduce = srInfo;
SrType = currentSrType; // the type of the existing SR
return true;
-
- case DialogResult.No:
- // Format - SrToIntroduce is already null
+ case LVMoHBAWarningDialog.UserSelectedOption.Format:
return true;
-
default:
return false;
}
@@ -864,38 +692,34 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
}
}
- private void HideAllErrorIconsAndLabels()
+ private Dictionary GetDeviceConfig(SR.SRTypes srType)
{
- foreach (var c in ErrorIcons.Concat(ErrorLabels))
- c.Visible = false;
- }
-
- private void HideAllSpinnerIcons()
- {
-
- foreach (var c in SpinnerControls)
- c.Visible = false;
- }
-
- private Dictionary GetDeviceConfig(SR.SRTypes srType)
- {
- Dictionary dconf = new Dictionary();
- ToStringWrapper iqn = comboBoxIscsiIqns.SelectedItem as ToStringWrapper;
- if (iqn == null || !LunMap.ContainsKey(getIscsiLUN()))
+ var iqn = comboBoxIscsiIqns.SelectedItem as ToStringWrapper;
+ if (iqn == null)
return null;
+ var selectedLan = getIscsiLUN();
+ if (!LunMap.TryGetValue(selectedLan, out ISCSIInfo info))
+ return null;
+
+ var dconf = new Dictionary();
+
if (srType == SR.SRTypes.gfs2)
{
if (_srToIntroduce != null && _srToIntroduce.Configuration != null)
dconf = _srToIntroduce.Configuration;
- dconf["provider"] = "iscsi";
- dconf["target"] = iqn.item.IpAddress;
- dconf["port"] = iqn.item.Port.ToString();
- dconf["targetIQN"] = getIscsiIQN();
- dconf["SCSIid"] = LunMap[getIscsiLUN()].ScsiID;
- dconf["chapuser"] = IScsiChapUserTextBox.Text;
- dconf["chappassword"] = IScsiChapSecretTextBox.Text;
+ dconf[PROVIDER] = "iscsi";
+ dconf[TARGET] = iqn.item.IpAddress;
+ dconf[PORT] = iqn.item.Port.ToString();
+ dconf[TARGETIQN] = getIscsiIQN();
+ dconf[SCSIID] = LunMap[selectedLan].ScsiID;
+
+ if (checkBoxUseChap.Checked)
+ {
+ dconf[CHAPUSER] = textBoxChapUser.Text;
+ dconf[CHAPPASSWORD] = textBoxChapPassword.Text;
+ }
return dconf;
}
@@ -906,20 +730,15 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
dconf[PORT] = iqn.item.Port.ToString();
dconf[TARGETIQN] = getIscsiIQN();
- ISCSIInfo info = LunMap[getIscsiLUN()];
if (info.LunID == -1)
- {
dconf[LUNSERIAL] = info.Serial;
- }
else
- {
dconf[SCSIID] = info.ScsiID;
- }
- if (IscsiUseChapCheckBox.Checked)
+ if (checkBoxUseChap.Checked)
{
- dconf[CHAPUSER] = IScsiChapUserTextBox.Text;
- dconf[CHAPPASSWORD] = IScsiChapSecretTextBox.Text;
+ dconf[CHAPUSER] = textBoxChapUser.Text;
+ dconf[CHAPPASSWORD] = textBoxChapPassword.Text;
}
return dconf;
@@ -927,26 +746,14 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
#region Accessors
+ private string ChapUser => checkBoxUseChap.Checked ? textBoxChapUser.Text : null;
+ private string ChapPassword => checkBoxUseChap.Checked ? textBoxChapPassword.Text : null;
+
public SrWizardType SrWizardType { private get; set; }
- public string UUID { get { return _srToIntroduce == null ? null : _srToIntroduce.UUID; } }
+ public string UUID => _srToIntroduce?.UUID;
- public long SRSize
- {
- get
- {
- ISCSIInfo info = LunMap[getIscsiLUN()];
- return info.Size;
- }
- }
-
- public Dictionary DeviceConfig
- {
- get
- {
- return GetDeviceConfig(SrType);
- }
- }
+ public Dictionary DeviceConfig => GetDeviceConfig(SrType);
public string SrDescription
{
@@ -958,6 +765,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
}
public SR.SRTypes SrType { get; set; }
+
#endregion
}
}
diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.resx b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.resx
index 72faa19e0..364b044e6 100644
--- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.resx
+++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.resx
@@ -145,472 +145,43 @@
GrowAndShrink
- 6
-
-
- Top, Left, Right
-
-
- 4
-
-
- Left
-
-
- True
-
-
- False
-
-
- NoControl
-
-
- 3, 7
-
-
- 63, 13
-
-
- 12
-
-
- Target &IQN:
-
-
- labelIscsiIQN
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel2
-
-
- 0
-
-
- Left, Right
-
-
- 75, 3
-
-
- 441, 21
-
-
- 13
-
-
- comboBoxIscsiIqns
-
-
- System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel2
-
-
- 1
-
-
- Left, Right
-
-
- 75, 30
-
-
- 441, 21
-
-
- 15
-
-
- comboBoxIscsiLuns
-
-
- System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel2
-
-
- 2
-
-
- Left
-
-
- True
-
-
- False
-
-
- NoControl
-
-
- 3, 34
-
-
- 66, 13
-
-
- 14
-
-
- Target &LUN:
-
-
- targetLunLabel
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel2
-
-
- 3
-
-
- Left, Right
-
-
- NoControl
-
-
- 97, 58
-
-
- 441, 17
-
-
- 114
-
-
- errorLabelAtTargetLUN
-
-
- False
-
-
- errorLabelAtTargetLUN
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel2
-
-
- 4
-
-
- Left
-
-
-
-
-
- NoControl
-
-
-
-
-
- 75, 58
-
-
- 16, 16
-
-
- 17
-
-
- False
-
-
- errorIconAtTargetLUN
-
-
- System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel2
-
-
5
-
- Left
+
+ Top, Left, Right
-
+
+ Segoe UI, 9pt
+
+
NoControl
-
- 522, 5
+
+ 3, 0
-
- 16, 16
+
+ 3, 0, 3, 5
-
- Zoom
+
+ 547, 36
-
- 115
-
-
- False
-
-
- spinnerIconAtTargetIqn
-
-
- XenAdmin.Controls.SpinnerIcon, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
-
-
- tableLayoutPanel2
-
-
- 6
-
-
- Left
-
-
- NoControl
-
-
- 522, 32
-
-
- 16, 16
-
-
- Zoom
-
-
- 116
-
-
- False
-
-
- spinnerIconAtTargetLun
-
-
- XenAdmin.Controls.SpinnerIcon, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
-
-
- tableLayoutPanel2
-
-
- 7
-
-
- Fill
-
-
- 3, 16
-
-
- 3
-
-
- 541, 79
-
-
+
0
-
- tableLayoutPanel2
+
+ Provide a target host for your iSCSI storage, indicating your target IQN and your target LUN before proceeding.
-
- System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ label11
-
- iSCSITargetGroupBox
-
-
- 0
-
-
- <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelIscsiIQN" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboBoxIscsiIqns" Row="0" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="comboBoxIscsiLuns" Row="1" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="targetLunLabel" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="errorLabelAtTargetLUN" Row="2" RowSpan="1" Column="2" ColumnSpan="2" /><Control Name="errorIconAtTargetLUN" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="spinnerIconAtTargetIqn" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="spinnerIconAtTargetLun" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings>
-
-
- False
-
-
- 3, 225
-
-
- 3, 10, 3, 3
-
-
- 547, 98
-
-
- 11
-
-
- iSCSI target
-
-
- iSCSITargetGroupBox
-
-
- XenAdmin.Controls.DecentGroupBox, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
-
-
- tableLayoutPanel1
-
-
- 0
-
-
- Left, Right
-
-
- True
-
-
- NoControl
-
-
- 179, 168
-
-
- 371, 13
-
-
- 113
-
-
- errorLabelAtCHAPPassword
-
-
- False
-
-
- errorLabelAtCHAPPassword
-
-
+
System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
tableLayoutPanel1
-
- 1
-
-
- Left
-
-
-
-
-
- NoControl
-
-
-
-
-
- 157, 167
-
-
- 16, 16
-
-
- 111
-
-
- False
-
-
- errorIconAtCHAPPassword
-
-
- System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 2
-
-
- Left
-
-
-
-
-
- NoControl
-
-
-
-
-
- 157, 70
-
-
- 16, 16
-
-
- 109
-
-
- False
-
-
- errorIconAtHostOrIP
-
-
- System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 3
-
-
- Left
-
-
- True
-
-
- False
-
-
- NoControl
-
-
- 3, 189
-
-
- 148, 23
-
-
- 10
-
-
- &Scan Target Host
-
-
- scanTargetHostButton
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 4
+
+ 0
Left
@@ -646,7 +217,7 @@
tableLayoutPanel1
- 5
+ 1
Left, Right
@@ -670,7 +241,7 @@
tableLayoutPanel1
- 6
+ 2
Left
@@ -703,7 +274,7 @@
tableLayoutPanel1
- 7
+ 3
Left
@@ -730,62 +301,92 @@
tableLayoutPanel1
- 8
+ 4
-
+
+ 157, 70
+
+
+ 16, 16
+
+
+ 118
+
+
+ errorIconAtHostOrIP
+
+
+ System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 5
+
+
Left, Right
-
- False
+
+ True
-
- 157, 115
+
+ 179, 71
-
- 275, 20
+
+ 371, 13
-
+
+ 5
+
+
+ label1
+
+
+ errorLabelAtHostOrIP
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 6
+
+
+ True
+
+
+ NoControl
+
+
+ 3, 99
+
+
+ 3, 10, 3, 3
+
+
+ 147, 17
+
+
+ 6
+
+
+ Use &CHAP authentication
+
+
+ checkBoxUseChap
+
+
+ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
7
-
- IScsiChapUserTextBox
-
-
- System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 9
-
-
- Left, Right
-
-
- False
-
-
- 157, 141
-
-
- 275, 20
-
-
- 9
-
-
- IScsiChapSecretTextBox
-
-
- System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 10
-
Left
@@ -799,13 +400,16 @@
NoControl
- 23, 118
+ 20, 125
+
+
+ 20, 0, 3, 0
88, 13
- 6
+ 7
CHAP &username:
@@ -820,7 +424,34 @@
tableLayoutPanel1
- 11
+ 8
+
+
+ Left, Right
+
+
+ False
+
+
+ 157, 122
+
+
+ 275, 20
+
+
+ 8
+
+
+ textBoxChapUser
+
+
+ System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 9
Left
@@ -835,13 +466,16 @@
NoControl
- 23, 144
+ 20, 151
+
+
+ 20, 0, 3, 0
87, 13
- 8
+ 9
CHAP pass&word:
@@ -856,109 +490,130 @@
tableLayoutPanel1
- 12
+ 10
-
- True
-
-
- NoControl
-
-
- 3, 92
-
-
- 147, 17
-
-
- 5
-
-
- Use &CHAP authentication
-
-
- IscsiUseChapCheckBox
-
-
- System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 13
-
-
- Top, Left, Right
-
-
- Segoe UI, 9pt
-
-
- NoControl
-
-
- 3, 0
-
-
- 3, 0, 3, 5
-
-
- 547, 36
-
-
- 108
-
-
- Provide a target host for your iSCSI storage, indicating your target IQN and your target LUN before proceeding.
-
-
- label11
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel1
-
-
- 14
-
-
+
Left, Right
-
- True
-
-
- NoControl
-
-
- 179, 71
-
-
- 371, 13
-
-
- 115
-
-
- errorLabelAtHostname
-
-
+
False
-
- errorLabelAtHostname
+
+ 157, 148
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 275, 20
-
+
+ 10
+
+
+ textBoxChapPassword
+
+
+ System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
tableLayoutPanel1
-
- 15
+
+ 11
+
+
+ 157, 174
+
+
+ 16, 16
+
+
+ 120
+
+
+ errorIconAtCHAPPassword
+
+
+ System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 12
+
+
+ Left, Right
+
+
+ True
+
+
+ 179, 175
+
+
+ 371, 13
+
+
+ 11
+
+
+ label1
+
+
+ errorLabelAtCHAPPassword
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 13
+
+
+ Left, Right
+
+
+ True
+
+
+ GrowAndShrink
+
+
+ False
+
+
+ NoControl
+
+
+ 3, 203
+
+
+ 3, 10, 3, 3
+
+
+ 104, 23
+
+
+ 148, 23
+
+
+ 12
+
+
+ &Scan Target Host
+
+
+ buttonScanTargetHost
+
+
+ System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 14
Left
@@ -967,7 +622,10 @@
NoControl
- 157, 192
+ 157, 206
+
+
+ 3, 10, 3, 3
16, 16
@@ -991,8 +649,383 @@
tableLayoutPanel1
+ 15
+
+
+ Top, Left, Right
+
+
+ True
+
+
+ GrowAndShrink
+
+
+ 4
+
+
+ Left
+
+
+ True
+
+
+ False
+
+
+ NoControl
+
+
+ 3, 7
+
+
+ 63, 13
+
+
+ 0
+
+
+ Target &IQN:
+
+
+ labelTargetIqn
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel2
+
+
+ 0
+
+
+ Left, Right
+
+
+ 75, 3
+
+
+ 441, 21
+
+
+ 1
+
+
+ comboBoxIscsiIqns
+
+
+ System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel2
+
+
+ 1
+
+
+ Left
+
+
+ NoControl
+
+
+ 522, 5
+
+
+ 16, 16
+
+
+ Zoom
+
+
+ 115
+
+
+ False
+
+
+ spinnerIconAtTargetIqn
+
+
+ XenAdmin.Controls.SpinnerIcon, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+
+
+ tableLayoutPanel2
+
+
+ 2
+
+
+ Left
+
+
+ True
+
+
+ False
+
+
+ NoControl
+
+
+ 3, 34
+
+
+ 66, 13
+
+
+ 2
+
+
+ Target &LUN:
+
+
+ labelTargetLun
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel2
+
+
+ 3
+
+
+ Left, Right
+
+
+ 75, 30
+
+
+ 441, 21
+
+
+ 3
+
+
+ comboBoxIscsiLuns
+
+
+ System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel2
+
+
+ 4
+
+
+ Left
+
+
+ NoControl
+
+
+ 522, 32
+
+
+ 16, 16
+
+
+ Zoom
+
+
+ 116
+
+
+ False
+
+
+ spinnerIconAtTargetLun
+
+
+ XenAdmin.Controls.SpinnerIcon, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+
+
+ tableLayoutPanel2
+
+
+ 5
+
+
+ 75, 57
+
+
+ 16, 16
+
+
+ 117
+
+
+ errorIconAtTargetLUN
+
+
+ System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel2
+
+
+ 6
+
+
+ Left, Right
+
+
+ True
+
+
+ 97, 58
+
+
+ 419, 13
+
+
+ 4
+
+
+ label1
+
+
+ errorLabelAtTargetLUN
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel2
+
+
+ 7
+
+
+ Top
+
+
+ 3, 16
+
+
+ 3
+
+
+ 541, 76
+
+
+ 0
+
+
+ tableLayoutPanel2
+
+
+ System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ iSCSITargetGroupBox
+
+
+ 0
+
+
+ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelTargetIqn" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboBoxIscsiIqns" Row="0" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="spinnerIconAtTargetIqn" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="labelTargetLun" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboBoxIscsiLuns" Row="1" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="spinnerIconAtTargetLun" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="errorIconAtTargetLUN" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="errorLabelAtTargetLUN" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings>
+
+
+ False
+
+
+ 3, 239
+
+
+ 3, 10, 3, 3
+
+
+ 547, 98
+
+
+ 13
+
+
+ iSCSI target
+
+
+ iSCSITargetGroupBox
+
+
+ XenAdmin.Controls.DecentGroupBox, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+
+
+ tableLayoutPanel1
+
+
16
+
+ True
+
+
+ GrowAndShrink
+
+
+ 2
+
+
+ errorIconBottom
+
+
+ System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanelError
+
+
+ 0
+
+
+ errorLabelBottom
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanelError
+
+
+ 1
+
+
+ Fill
+
+
+ 3, 350
+
+
+ 3, 10, 3, 3
+
+
+ 1
+
+
+ 547, 22
+
+
+ 14
+
+
+ tableLayoutPanelError
+
+
+ System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 17
+
+
+ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="errorIconBottom" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="errorLabelBottom" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="Percent,100" /></TableLayoutSettings>
+
Top
@@ -1000,10 +1033,10 @@
0, 0
- 9
+ 10
- 553, 326
+ 553, 375
0
@@ -1021,30 +1054,57 @@
0
- <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="iSCSITargetGroupBox" Row="8" RowSpan="1" Column="0" ColumnSpan="6" /><Control Name="errorLabelAtCHAPPassword" Row="6" RowSpan="1" Column="3" ColumnSpan="3" /><Control Name="errorIconAtCHAPPassword" Row="6" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="errorIconAtHostOrIP" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="scanTargetHostButton" Row="7" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="labelIscsiTargetHost" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="textBoxIscsiHost" Row="1" RowSpan="1" Column="2" ColumnSpan="2" /><Control Name="labelColon" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="textBoxIscsiPort" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="IScsiChapUserTextBox" Row="4" RowSpan="1" Column="2" ColumnSpan="2" /><Control Name="IScsiChapSecretTextBox" Row="5" RowSpan="1" Column="2" ColumnSpan="2" /><Control Name="labelCHAPuser" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="IScsiChapSecretLabel" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="IscsiUseChapCheckBox" Row="3" RowSpan="1" Column="0" ColumnSpan="6" /><Control Name="label11" Row="0" RowSpan="1" Column="0" ColumnSpan="6" /><Control Name="errorLabelAtHostname" Row="2" RowSpan="1" Column="3" ColumnSpan="3" /><Control Name="spinnerIconAtScanTargetHostButton" Row="7" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Absolute,20,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings>
+ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label11" Row="0" RowSpan="1" Column="0" ColumnSpan="5" /><Control Name="labelIscsiTargetHost" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxIscsiHost" Row="1" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="labelColon" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="textBoxIscsiPort" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="errorIconAtHostOrIP" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="errorLabelAtHostOrIP" Row="2" RowSpan="1" Column="2" ColumnSpan="3" /><Control Name="checkBoxUseChap" Row="3" RowSpan="1" Column="0" ColumnSpan="5" /><Control Name="labelCHAPuser" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxChapUser" Row="4" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="IScsiChapSecretLabel" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxChapPassword" Row="5" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="errorIconAtCHAPPassword" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="errorLabelAtCHAPPassword" Row="6" RowSpan="1" Column="2" ColumnSpan="3" /><Control Name="buttonScanTargetHost" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="spinnerIconAtScanTargetHostButton" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="iSCSITargetGroupBox" Row="8" RowSpan="1" Column="0" ColumnSpan="5" /><Control Name="tableLayoutPanelError" Row="9" RowSpan="1" Column="0" ColumnSpan="5" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0,AutoSize,0,Absolute,20" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings>
-
- Top, Right
+
+ 3, 3
-
- 392, 246
+
+ 16, 16
-
- 115, 23
+
+ 0
-
- 3
+
+ errorIconBottom
-
- toolTipContainerIQNscan
+
+ System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+
+ tableLayoutPanelError
-
- $this
+
+ 0
-
+
+ Left, Right
+
+
+ True
+
+
+ 25, 4
+
+
+ 519, 13
+
+
+ 0
+
+
+ label1
+
+
+ errorLabelBottom
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanelError
+
+
1
@@ -1057,7 +1117,7 @@
96, 96
- 553, 353
+ 553, 392
LVMoISCSI
diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs
index d75d8a8ab..59b0ae59c 100644
--- a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs
+++ b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs
@@ -77,17 +77,9 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages
return null;
}
- private static bool NameExists(String potentialName, IEnumerable names)
+ public static string DefaultSRName(string potentialName, List names)
{
- if (names != null)
- return names.Any(name => name.Equals(potentialName));
-
- return false;
- }
-
- public static String DefaultSRName(String potentialName, IEnumerable names)
- {
- if (!NameExists(potentialName, names))
+ if (!names.Contains(potentialName))
return potentialName;
int i = 0;
@@ -96,16 +88,16 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages
{
i++;
- String name = string.Format(Messages.NEWVM_DEFAULTNAME, potentialName, i);
+ string name = string.Format(Messages.NEWVM_DEFAULTNAME, potentialName, i);
- if (!NameExists(name, names))
+ if (!names.Contains(name))
return name;
}
}
- public static String DefaultSRName(String potentialName, IXenConnection connection)
+ public static string DefaultSRName(string potentialName, IXenConnection connection)
{
- return DefaultSRName(potentialName, connection.Cache.SRs.Select(sr => sr.Name()));
+ return DefaultSRName(potentialName, connection.Cache.SRs.Select(sr => sr.Name()).ToList());
}
}
}
diff --git a/XenAdmin/XenAdmin.csproj b/XenAdmin/XenAdmin.csproj
index 71e6c6d06..7182d3c31 100755
--- a/XenAdmin/XenAdmin.csproj
+++ b/XenAdmin/XenAdmin.csproj
@@ -1298,12 +1298,6 @@
DialogWithProgress.cs
-
- Form
-
-
- IscsiChoicesDialog.cs
-
Form
@@ -2643,10 +2637,6 @@
ThreeButtonDialog.cs
Designer
-
- IscsiChoicesDialog.cs
- Designer
-
Designer
ActionProgressDialog.cs
@@ -3335,7 +3325,6 @@
-
@@ -5382,12 +5371,6 @@
InputPromptDialog.cs
-
- IscsiChoicesDialog.cs
-
-
- IscsiChoicesDialog.cs
-
IscsiDeviceConfigDialog.cs
diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs
index bf4738ece..fa36861c9 100755
--- a/XenModel/Messages.Designer.cs
+++ b/XenModel/Messages.Designer.cs
@@ -12394,15 +12394,6 @@ namespace XenAdmin {
}
}
- ///
- /// Looks up a localized string similar to [XenCenter] has detected that an SR already exists on this LUN. This SR is not currently in use by '{0}', would you like to attach it?.
- ///
- public static string DETACHED_ISCI_DETECTED {
- get {
- return ResourceManager.GetString("DETACHED_ISCI_DETECTED", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Details.
///
@@ -15881,17 +15872,6 @@ namespace XenAdmin {
}
}
- ///
- /// Looks up a localized string similar to An existing {0} SR was found on the selected LUN. Click Reattach to use the existing SR, or click Format to destroy any data present on the disk and create a new {1} SR.
- ///
- ///Warning: to prevent data loss you must ensure that the LUN is not in use by any other system, including servers that are not connected to [XenCenter]..
- ///
- public static string EXISTING_SR_FOUND_ON_LUN {
- get {
- return ResourceManager.GetString("EXISTING_SR_FOUND_ON_LUN", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Exit &Maintenance Mode.
///
@@ -21301,7 +21281,7 @@ namespace XenAdmin {
}
///
- /// Looks up a localized string similar to Invalid host name.
+ /// Looks up a localized string similar to Invalid target host.
///
public static string INVALID_HOST {
get {
@@ -21490,18 +21470,6 @@ namespace XenAdmin {
}
}
- ///
- /// Looks up a localized string similar to Vendor: {0}
- ///Serial Number: {1}
- ///SCSI ID: {2}
- ///Size: {3}.
- ///
- public static string ISCSI_DIALOG_SR_DETAILS_FOR_FIBRECHANNEL {
- get {
- return ResourceManager.GetString("ISCSI_DIALOG_SR_DETAILS_FOR_FIBRECHANNEL", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Interrogation failed -- call succeeded!.
///
@@ -26246,17 +26214,6 @@ namespace XenAdmin {
}
}
- ///
- /// Looks up a localized string similar to Creating a new virtual disk on this LUN will destroy any data present. You must ensure that no other system is using the LUN, including any servers, or the virtual disk may become corrupted while in use.
- ///
- ///Do you want to format the disk?.
- ///
- public static string NEWSR_ISCSI_FORMAT_WARNING {
- get {
- return ResourceManager.GetString("NEWSR_ISCSI_FORMAT_WARNING", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to NFS ISO Library [{0}].
///
diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx
index 0f24b71ce..b4c922334 100755
--- a/XenModel/Messages.resx
+++ b/XenModel/Messages.resx
@@ -4394,9 +4394,6 @@ This will also delete its subfolders.
{0} (Detached)
-
- [XenCenter] has detected that an SR already exists on this LUN. This SR is not currently in use by '{0}', would you like to attach it?
-
&Detach all
@@ -5571,11 +5568,6 @@ Would you like to eject these ISOs before continuing?
User canceled. Master needs to be upgraded first.
-
- An existing {0} SR was found on the selected LUN. Click Reattach to use the existing SR, or click Format to destroy any data present on the disk and create a new {1} SR.
-
-Warning: to prevent data loss you must ensure that the LUN is not in use by any other system, including servers that are not connected to [XenCenter].
-
Exit &Maintenance Mode
@@ -7398,7 +7390,7 @@ This might result in failure to migrate VMs to this server during the RPU or to
Invalid disk size
- Invalid host name
+ Invalid target host.
Invalid number
@@ -7457,12 +7449,6 @@ This might result in failure to migrate VMs to this server during the RPU or to
SR size: {0}
SR UUID: {1}
-
-
- Vendor: {0}
-Serial Number: {1}
-SCSI ID: {2}
-Size: {3}
Interrogation failed -- call succeeded!
@@ -8961,11 +8947,6 @@ When you configure a SMB storage repository, you simply provide the host name or
iSCSI SR [{0} ({1}; {2})]
-
- Creating a new virtual disk on this LUN will destroy any data present. You must ensure that no other system is using the LUN, including any servers, or the virtual disk may become corrupted while in use.
-
-Do you want to format the disk?
-
NFS ISO Library [{0}]