Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@
// under the License.
package com.cloud.agent.resource.consoleproxy;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
Expand All @@ -49,10 +44,7 @@
import com.cloud.agent.api.ReadyCommand;
import com.cloud.agent.api.StartupCommand;
import com.cloud.agent.api.StartupProxyCommand;
import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
import com.cloud.agent.api.proxy.ConsoleProxyLoadAnswer;
import com.cloud.agent.api.proxy.StartConsoleProxyAgentHttpHandlerCommand;
import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand;
import com.cloud.exception.AgentControlChannelException;
import com.cloud.host.Host;
import com.cloud.host.Host.Type;
Expand Down Expand Up @@ -94,11 +86,7 @@ public class ConsoleProxyResource extends ServerResourceBase implements ServerRe

@Override
public Answer executeRequest(final Command cmd) {
if (cmd instanceof CheckConsoleProxyLoadCommand) {
return execute((CheckConsoleProxyLoadCommand)cmd);
} else if (cmd instanceof WatchConsoleProxyLoadCommand) {
return execute((WatchConsoleProxyLoadCommand)cmd);
} else if (cmd instanceof ReadyCommand) {
if (cmd instanceof ReadyCommand) {
logger.info("Receive ReadyCommand, response with ReadyAnswer");
return new ReadyAnswer((ReadyCommand)cmd);
} else if (cmd instanceof CheckHealthCommand) {
Expand Down Expand Up @@ -142,51 +130,6 @@ private void disableRpFilter() {
}
}

protected Answer execute(final CheckConsoleProxyLoadCommand cmd) {
return executeProxyLoadScan(cmd, cmd.getProxyVmId(), cmd.getProxyVmName(), cmd.getProxyManagementIp(), cmd.getProxyCmdPort());
}

protected Answer execute(final WatchConsoleProxyLoadCommand cmd) {
return executeProxyLoadScan(cmd, cmd.getProxyVmId(), cmd.getProxyVmName(), cmd.getProxyManagementIp(), cmd.getProxyCmdPort());
}

private Answer executeProxyLoadScan(final Command cmd, final long proxyVmId, final String proxyVmName, final String proxyManagementIp, final int cmdPort) {
String result = null;

final StringBuffer sb = new StringBuffer();
sb.append("http://").append(proxyManagementIp).append(":" + cmdPort).append("/cmd/getstatus");

boolean success = true;
try {
final URL url = new URL(sb.toString());
final URLConnection conn = url.openConnection();

final InputStream is = conn.getInputStream();
final BufferedReader reader = new BufferedReader(new InputStreamReader(is,"UTF-8"));
final StringBuilder sb2 = new StringBuilder();
String line = null;
try {
while ((line = reader.readLine()) != null)
sb2.append(line + "\n");
result = sb2.toString();
} catch (final IOException e) {
success = false;
} finally {
try {
is.close();
} catch (final IOException e) {
logger.warn("Exception when closing , console proxy address: {}", proxyManagementIp);
success = false;
}
}
} catch (final IOException e) {
logger.warn("Unable to open console proxy command port url, console proxy address: {}", proxyManagementIp);
success = false;
}

return new ConsoleProxyLoadAnswer(cmd, proxyVmId, proxyVmName, success, result);
}

@Override
protected String getDefaultScriptsDir() {
return null;
Expand Down
1 change: 0 additions & 1 deletion api/src/main/java/com/cloud/storage/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ public static enum StoragePoolType {
SMB(true, false, EncryptionSupport.Unsupported),
Gluster(true, false, EncryptionSupport.Unsupported),
PowerFlex(true, true, EncryptionSupport.Hypervisor), // Dell EMC PowerFlex/ScaleIO (formerly VxFlexOS)
ManagedNFS(true, false, EncryptionSupport.Unsupported),
Linstor(true, true, EncryptionSupport.Storage),
DatastoreCluster(true, true, EncryptionSupport.Unsupported), // for VMware, to abstract pool of clusters
StorPool(true, true, EncryptionSupport.Hypervisor),
Expand Down
2 changes: 0 additions & 2 deletions api/src/test/java/com/cloud/storage/StorageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public void isSharedStoragePool() {
Assert.assertTrue(StoragePoolType.OCFS2.isShared());
Assert.assertTrue(StoragePoolType.SMB.isShared());
Assert.assertTrue(StoragePoolType.Gluster.isShared());
Assert.assertTrue(StoragePoolType.ManagedNFS.isShared());
Assert.assertTrue(StoragePoolType.DatastoreCluster.isShared());
Assert.assertTrue(StoragePoolType.Linstor.isShared());
}
Expand All @@ -70,7 +69,6 @@ public void supportsOverProvisioningTestAllStoragePoolTypes() {
Assert.assertFalse(StoragePoolType.OCFS2.supportsOverProvisioning());
Assert.assertFalse(StoragePoolType.SMB.supportsOverProvisioning());
Assert.assertFalse(StoragePoolType.Gluster.supportsOverProvisioning());
Assert.assertFalse(StoragePoolType.ManagedNFS.supportsOverProvisioning());
Assert.assertTrue(StoragePoolType.DatastoreCluster.supportsOverProvisioning());
Assert.assertTrue(StoragePoolType.Linstor.supportsOverProvisioning());
}
Expand Down
55 changes: 0 additions & 55 deletions core/src/main/java/com/cloud/agent/api/AttachIsoAnswer.java

This file was deleted.

86 changes: 0 additions & 86 deletions core/src/main/java/com/cloud/agent/api/AttachIsoCommand.java

This file was deleted.

46 changes: 0 additions & 46 deletions core/src/main/java/com/cloud/agent/api/BackupSnapshotAnswer.java

This file was deleted.

Loading
Loading