mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Bug 12777 - Add storage network configuration into CloudStack
basic done
This commit is contained in:
parent
f72940e041
commit
6c8c657e2b
@ -114,6 +114,8 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||||||
private String _localgw;
|
private String _localgw;
|
||||||
private String _eth1mask;
|
private String _eth1mask;
|
||||||
private String _eth1ip;
|
private String _eth1ip;
|
||||||
|
private String _storageIp;
|
||||||
|
private String _storageNetmask;
|
||||||
final private String _parent = "/mnt/SecStorage";
|
final private String _parent = "/mnt/SecStorage";
|
||||||
final private String _tmpltDir = "/var/cloudstack/template";
|
final private String _tmpltDir = "/var/cloudstack/template";
|
||||||
final private String _tmpltpp = "template.properties";
|
final private String _tmpltpp = "template.properties";
|
||||||
@ -555,7 +557,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||||||
InetAddress nfsHostAddr = InetAddress.getByName(nfsHost);
|
InetAddress nfsHostAddr = InetAddress.getByName(nfsHost);
|
||||||
String nfsHostIp = nfsHostAddr.getHostAddress();
|
String nfsHostIp = nfsHostAddr.getHostAddress();
|
||||||
|
|
||||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, nfsHostIp);
|
addRouteToInternalIpOrCidr(_storageIp, _storageIp, _storageNetmask, nfsHostIp);
|
||||||
String nfsPath = nfsHostIp + ":" + uri.getPath();
|
String nfsPath = nfsHostIp + ":" + uri.getPath();
|
||||||
String dir = UUID.nameUUIDFromBytes(nfsPath.getBytes()).toString();
|
String dir = UUID.nameUUIDFromBytes(nfsPath.getBytes()).toString();
|
||||||
String root = _parent + "/" + dir;
|
String root = _parent + "/" + dir;
|
||||||
@ -918,6 +920,11 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||||||
_publicIp = (String) params.get("eth2ip");
|
_publicIp = (String) params.get("eth2ip");
|
||||||
_hostname = (String) params.get("name");
|
_hostname = (String) params.get("name");
|
||||||
|
|
||||||
|
_storageIp = (String) params.get("storageip");
|
||||||
|
if (_storageIp == null) {
|
||||||
|
s_logger.warn("Wait, there is no storageip in /proc/cmdline, something wrong!");
|
||||||
|
}
|
||||||
|
_storageNetmask = (String) params.get("storagenetmask");
|
||||||
super.configure(name, params);
|
super.configure(name, params);
|
||||||
|
|
||||||
_params = params;
|
_params = params;
|
||||||
|
|||||||
@ -11,10 +11,12 @@ COMMIT
|
|||||||
:HTTP - [0:0]
|
:HTTP - [0:0]
|
||||||
-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||||
-A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
-A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||||
-A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
-A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||||
|
-A INPUT -i eth3 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||||
-A INPUT -i lo -j ACCEPT
|
-A INPUT -i lo -j ACCEPT
|
||||||
-A INPUT -p icmp --icmp-type 13 -j DROP
|
-A INPUT -p icmp --icmp-type 13 -j DROP
|
||||||
-A INPUT -p icmp -j ACCEPT
|
-A INPUT -p icmp -j ACCEPT
|
||||||
-A INPUT -i eth0 -p tcp -m state --state NEW --dport 3922 -j ACCEPT
|
-A INPUT -i eth0 -p tcp -m state --state NEW --dport 3922 -j ACCEPT
|
||||||
-A INPUT -i eth1 -p tcp -m state --state NEW --dport 3922 -j ACCEPT
|
-A INPUT -i eth1 -p tcp -m state --state NEW --dport 3922 -j ACCEPT
|
||||||
|
-A INPUT -i eth3 -p tcp -m state --state NEW --dport 3922 -j ACCEPT
|
||||||
COMMIT
|
COMMIT
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user