You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mt...@apache.org on 2014/01/05 05:13:53 UTC
git commit: updated refs/heads/4.3 to 811b085
Updated Branches:
refs/heads/4.3 29aa7c272 -> 811b0856d
CLOUDSTACK-5662: XenServer can't discover iSCSI targets with different credentials
VAGs
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/811b0856
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/811b0856
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/811b0856
Branch: refs/heads/4.3
Commit: 811b0856d512df163f29eb07e3f95d0ac80ed6fa
Parents: 29aa7c2
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Fri Jan 3 22:25:40 2014 -0700
Committer: Mike Tutkowski <mi...@solidfire.com>
Committed: Sat Jan 4 21:11:14 2014 -0700
----------------------------------------------------------------------
.../kvm/resource/LibvirtComputingResource.java | 27 ++++++++++++++++++++
1 file changed, 27 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/811b0856/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 57538f9..66608a8 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -4073,6 +4073,7 @@ ServerResource {
cmd.setCluster(_clusterId);
cmd.setGatewayIpAddress(_localGateway);
cmd.setHostVmStateReport(getHostVmStateReport());
+ cmd.setIqn(getIqn());
StartupStorageCommand sscmd = null;
try {
@@ -4102,6 +4103,32 @@ ServerResource {
}
}
+ private String getIqn() {
+ try {
+ final String textToFind = "InitiatorName=";
+
+ Script iScsiAdmCmd = new Script(true, "grep", 0, s_logger);
+
+ iScsiAdmCmd.add(textToFind);
+ iScsiAdmCmd.add("/etc/iscsi/initiatorname.iscsi");
+
+ OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser();
+
+ String result = iScsiAdmCmd.execute(parser);
+
+ if (result != null) {
+ return null;
+ }
+
+ String textFound = parser.getLine().trim();
+
+ return textFound.substring(textToFind.length());
+ }
+ catch (Exception ex) {
+ return null;
+ }
+ }
+
protected HashMap<String, State> sync() {
HashMap<String, State> newStates;
HashMap<String, State> oldStates = null;