bug 8380: use instance name status 8380: resolved fixed

This commit is contained in:
Chiradeep Vittal 2011-02-22 13:47:42 -08:00
parent 035dd38fc8
commit 697b4f60db
3 changed files with 14 additions and 4 deletions

View File

@ -241,6 +241,8 @@ public abstract class CitrixResourceBase implements ServerResource {
protected String _storageNetworkName2;
protected String _guestNetworkName;
protected int _wait;
protected String _instance; //instance name (default is usually "VM")
protected IAgentControl _agentControl;
int _userVMCap = 0;
@ -572,6 +574,7 @@ public abstract class CitrixResourceBase implements ServerResource {
return null;
}
<<<<<<< HEAD
private synchronized Network createTunnelNetwork(Connection conn, long account) {
try {
String nwName = "OVSTunnel" + account;
@ -594,6 +597,7 @@ public abstract class CitrixResourceBase implements ServerResource {
return null;
}
}
protected Network getNetwork(Connection conn, NicTO nic) throws XenAPIException, XmlRpcException {
Pair<Network, String> network = getNativeNetworkForTraffic(conn, nic.getType());
@ -4345,6 +4349,7 @@ public abstract class CitrixResourceBase implements ServerResource {
_privateNetworkName = (String) params.get("private.network.device");
_publicNetworkName = (String) params.get("public.network.device");
_guestNetworkName = (String)params.get("guest.network.device");
_instance = (String) params.get("instance.name");
_linkLocalPrivateNetworkName = (String) params.get("private.linkLocal.device");
if (_linkLocalPrivateNetworkName == null) {

View File

@ -828,11 +828,14 @@ def cleanup_rules_for_dead_vms(session):
util.SMlog("Failed to cleanup rules for dead vms!")
@echo
def cleanup_rules(session, args):
instance = args.get('instance')
if not instance:
instance = 'VM'
try:
chainscmd = "iptables-save | grep '^:' | awk '{print $1}' | cut -d':' -f2 | sed 's/-def/-VM/'|sort|uniq"
chainscmd = "iptables-save | grep '^:' | awk '{print $1}' | cut -d':' -f2 | sed 's/-def/-%s/'|sort|uniq" % instance
chains = util.pread2(['/bin/bash', '-c', chainscmd]).split('\n')
cleaned = 0
cleanup = []

View File

@ -99,8 +99,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
private String _maxProductVersion;
private String _maxXapiVersion;
private String _maxXenVersion;
protected String _instance;
@Inject protected AlertManager _alertMgr;
@Inject protected AgentManager _agentMgr;
@ -279,6 +278,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
}
params.put(Config.Wait.toString().toLowerCase(), Integer.toString(_wait));
details.put(Config.Wait.toString().toLowerCase(), Integer.toString(_wait));
params.put(Config.InstanceName.toString().toLowerCase(), _instance);
try {
resource.configure("Xen Server", params);
} catch (ConfigurationException e) {
@ -432,6 +432,8 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
String value = _params.get(Config.XapiWait.toString());
_wait = NumbersUtil.parseInt(value, Integer.parseInt(Config.XapiWait.getDefaultValue()));
_instance = _params.get(Config.InstanceName.key());
value = _params.get(Config.XenSetupMultipath.key());
Boolean.parseBoolean(value);