Revision 4baa4696

b/snf-deploy/conf/nodes.conf
2 2
# with nodes (both ganeti and synnefo) residing in the same subnet/domain
3 3
[network]
4 4
domain = synnefo.live
5
subnet = 192.168.0.0/28
6
gateway = 192.168.0.14
7 5

  
8 6
[os]
9 7
node1 = squeeze
b/snf-deploy/conf/vcluster.conf
34 34
# ip addr add 192.0.0.14/28 dev auto_nodes_br
35 35
# To create run: snf-deploy cluster
36 36
bridge = auto_nodes_br
37

  
38
[network]
39
subnet = 192.168.0.0/28
40
gateway = 192.168.0.14
b/snf-deploy/fabfile.py
79 79
    host_info = env.env.ips_info[env.host]
80 80
    if ast.literal_eval(env.env.use_local_packages):
81 81
        with settings(warn_only=True):
82
            deb = local("ls %s/%s*%s.deb" % (env.env.packages, package, host_info[os]))
82
            deb = local("ls %s/%s*%s_all.deb" % (env.env.packages, package, host_info[os]))
83 83
            if deb:
84 84
                debug(env.host, " * Package %s found in %s..." % (package, env.env.packages))
85 85
                put(deb, "/tmp/")
......
89 89

  
90 90
    info = getattr(env.env, package)
91 91
    if info in ["squeeze-backports", "stable", "testing", "unstable"]:
92
        if  info == "squeeze-backports" and host_infa.os = "wheezy":
92
        if  info == "squeeze-backports" and host_infa.os == "wheezy":
93 93
          info = host_info.os
94 94
        APT_GET += " -t %s %s " % (info, package)
95 95
    elif info:
......
737 737
    if env.host == env.env.pithos.ip:
738 738
      return
739 739

  
740
    host_info = env.env.ips_info[env.host]
740 741
    debug(env.host, " * Mounting pithos NFS mount point...")
741 742
    with settings(hide("everything")):
742 743
        try_run("ping -c1 " + env.env.pithos.hostname)
744
    with settings(host_string=env.env.pithos.ip):
745
        update_nfs_exports(host_info.ip)
746

  
743 747
    install_package("nfs-common")
744
    for d in [env.env.pithos_dir, "/srv/okeanos"]:
748
    for d in [env.env.pithos_dir, env.env.image_dir]:
745 749
      try_run("mkdir -p " + d)
746 750
      cmd = """
747
      echo "{0}:/{1} {2}  nfs4 defaults,rw,noatime,nodiratime,intr,rsize=1048576,wsize=1048576,noacl" >> /etc/fstab
748
      """.format(env.env.pithos.hostname, os.path.basename(d), d)
751
      echo "{0}:{1} {1}  nfs defaults,rw,noatime,rsize=131072,wsize=131072,timeo=14,intr,noacl" >> /etc/fstab
752
      """.format(env.env.pithos.ip, d)
749 753
      try_run(cmd)
750 754
      try_run("mount " + d)
751 755

  
752

  
753 756
@roles("pithos")
754
def setup_nfs_server():
755
    debug(env.host, " * Setting up NFS server for pithos...")
756
    setup_nfs_dirs()
757
    install_package("nfs-kernel-server")
758
    tmpl = "/etc/exports"
757
def update_nfs_exports(ip):
758
    tmpl = "/tmp/exports"
759 759
    replace = {
760 760
      "pithos_dir": env.env.pithos_dir,
761
      "srv": os.path.dirname(env.env.pithos_dir),
762
      "subnet": env.env.subnet
761
      "image_dir": env.env.image_dir,
762
      "ip": ip,
763 763
      }
764 764
    custom = customize_settings_from_tmpl(tmpl, replace)
765 765
    put(custom, tmpl)
766
    try_run("cat %s >> /etc/exports" % tmpl)
766 767
    try_run("/etc/init.d/nfs-kernel-server restart")
767 768

  
769
@roles("pithos")
770
def setup_nfs_server():
771
    debug(env.host, " * Setting up NFS server for pithos...")
772
    setup_nfs_dirs()
773
    install_package("nfs-kernel-server")
774

  
768 775

  
769 776
@roles("pithos")
770 777
def setup_pithos():
......
963 970
    debug(env.host, "Setting up snf-image...")
964 971
    install_package("snf-pithos-backend")
965 972
    install_package("snf-image")
966
    try_run("mkdir -p /srv/okeanos")
973
    try_run("mkdir -p %s" % env.env.image_dir)
967 974
    tmpl = "/etc/default/snf-image"
968 975
    replace = {
969 976
        "synnefo_user": env.env.synnefo_user,
......
1272 1279
def add_image_locally():
1273 1280
    debug(env.host, " * Getting image locally in order snf-image to use it directly..")
1274 1281
    image = "debian_base.diskdump"
1275
    try_run("wget {0} -O /srv/okeanos/{1}".format(env.env.debian_base_url, image))
1282
    try_run("wget {0} -O {1}/{2}".format(env.env.debian_base_url, env.env.image_dir, image))
1276 1283

  
1277 1284

  
1278 1285
@roles("master")
/dev/null
1
%PITHOS_DIR% %SUBNET%(rw,sync,no_subtree_check,no_root_squash)
2
/srv/okeanos %SUBNET%(rw,sync,no_subtree_check,no_root_squash)
3
%SRV% %SUBNET%(rw,fsid=0,no_subtree_check,sync,no_root_squash)
4

  
b/snf-deploy/files/tmp/exports
1
%PITHOS_DIR% %IP%(rw,async,no_subtree_check,no_root_squash)
2
%IMAGE_DIR% %IP%(rw,async,no_subtree_check,no_root_squash)
3

  
b/snf-deploy/snfdeploy/lib.py
124 124
            self.ips_info[host.ip] = host
125 125

  
126 126
        self.cluster = Host(self.cluster_name, self.cluster_ip, None,
127
                            self.domain)
127
                            self.domain, None)
128 128
        self.master = self.nodes_info[self.master_node]
129 129

  
130 130
        self.roles = {}
......
138 138
    files = {
139 139
        "nodes": ["network", "info"],
140 140
        "deploy": ["dirs", "packages", "keys", "options"],
141
        "vcluster": ["cluster", "image"],
141
        "vcluster": ["cluster", "image", "network"],
142 142
        "synnefo": ["cred", "synnefo", "roles"],
143 143
        "packages": ["debian", "ganeti", "synnefo", "other"],
144 144
        "ganeti": [],
......
196 196
        #domain = get_domain()
197 197
        #if domain:
198 198
        #    self.nodes.set("network", "domain", get_domain())
199
        self.nodes.set("network", "subnet", "/".join(get_netinfo()))
200
        self.nodes.set("network", "gateway", get_default_route()[0])
199
        # self.nodes.set("network", "subnet", "/".join(get_netinfo()))
200
        # self.nodes.set("network", "gateway", get_default_route()[0])
201 201
        self.nodes.set("hostnames", "node1", get_hostname())
202 202
        self.nodes.set("ips", "node1", get_netinfo()[0])
203 203
        self.nodes.set("info", "nodes", "node1")

Also available in: Unified diff