Merge lp:~thomnico/orange-box/newnet into lp:orange-box

Proposed by Nicolas Thomas
Status: Needs review
Proposed branch: lp:~thomnico/orange-box/newnet
Merge into: lp:orange-box
Diff against target: 1828 lines (+204/-672)
22 files modified
debian/changelog (+57/-11)
debian/control (+6/-4)
debian/install (+3/-0)
debian/links (+1/-1)
debian/postinst (+0/-310)
debian/postrm (+0/-23)
debian/preinst (+0/-136)
debian/source/format (+1/-1)
etc/apt/orange-box-mirror.list (+1/-1)
usr/bin/orange-box-add-node (+7/-4)
usr/bin/orange-box-add-physical-nodes (+7/-2)
usr/bin/orange-box-add-virtual-nodes (+31/-12)
usr/bin/orange-box-amt-monitor (+3/-1)
usr/bin/orange-box-apm-power-fix (+0/-38)
usr/bin/orange-box-bootstrap-juju (+5/-1)
usr/bin/orange-box-create-package-mirror (+14/-1)
usr/bin/orange-box-demo-cleanup (+3/-1)
usr/bin/orange-box-hacks (+32/-0)
usr/bin/orange-box-purge-everything (+1/-0)
usr/bin/orange-box-run (+21/-18)
usr/bin/orange-box-setup-nat (+0/-99)
usr/bin/orange-box-status-all-nodes (+11/-8)
To merge this branch: bzr merge lp:~thomnico/orange-box/newnet
Reviewer Review Type Date Requested Status
Nicolas Thomas (community) Needs Information
Review via email: mp+261775@code.launchpad.net

Description of the change

Tested version of the orange-box package to work with the new network setup.

Active review/test needed.

To post a comment you must log in.
Revision history for this message
Zhanglei Mao (zhanglei-mao) wrote :

Test it on Ubuntu 14.04.2 X64 server + MAAS 1.8 and Ubuntu 14.04.2 X64 Desktop + MAAS 1.7, both are stop at:

+ run-one-until-success maas admin node-group-interface update 3b3deac8-ce39-4fb6-b0a2-74ab32474fce br0 ip_range_low=172.27.9.1 ip_range_high=172.27.9.254 static_ip_range_low=172.27.10.1 static_ip_range_high=172.27.10.254 management=2 broadcast_ip=172.27.11.255 router_ip=172.27.8.1
Not FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot Found^Cdpkg: error processing package orange-box (--configure):
subprocess installed post-installation script was interrupted
E: Sub-process /usr/bin/dpkg exited unexpectedly
W: Operation was interrupted before it could finish

The problem seems of matching in "br0" and "eth1"

ubuntu@OrangeBox8:~$ sudo maas admin node-groups list
Success.
Machine-readable output follows:
[
    {
        "cluster_name": "Cluster master",
        "status": 1,
        "name": "maas",
        "uuid": "3b3deac8-ce39-4fb6-b0a2-74ab32474fce"
    }
]
ubuntu@OrangeBox8:~$ sudo maas admin node-group-interfaces list 3b3deac8-ce39-4fb6-b0a2-74ab32474fce
Success.
Machine-readable output follows:
[
    {
        "ip_range_high": null,
        "ip_range_low": null,
        "broadcast_ip": "172.27.255.255",
        "static_ip_range_low": null,
        "name": "eth1",
        "ip": "172.27.252.8",
        "subnet_mask": "255.255.252.0",
        "management": 0,
        "static_ip_range_high": null,
        "interface": "eth1"
    }
]

It cab update as below:

ubuntu@OrangeBox8:~$ sudo maas admin node-group-interface update 3b3deac8-ce39-4fb6-b0a2-74ab32474fce eth1 ip_range_low=172.27.9.1 ip_range_high=172.27.9.254 static_ip_range_low=172.27.10.1 static_ip_range_high=172.27.10.254 management=2 broadcast_ip=172.27.11.255 router_ip=172.27.8.1
{"ip_range_high": ["172.27.9.254 not in the 172.27.252.0/22 network"], "ip_range_low": ["172.27.9.1 not in the 172.27.252.0/22 network"], "broadcast_ip": ["172.27.11.255 not in the 172.27.252.0/22 network"], "static_ip_range_low": ["172.27.10.1 not in the 172.27.252.0/22 network"], "router_ip": ["172.27.8.1 not in the 172.27.252.0/22 network"], "static_ip_range_high": ["172.27.10.254 not in the 172.27.252.0/22 network"]}

The br0 interface seem correct, but I didn't command which created the interface listed by the command of '$ sudo maas admin node-group-interfaces list 3b3deac8-ce39-4fb6-b0a2-74ab32474fce'

Revision history for this message
Nicolas Thomas (thomnico) wrote :

Mao,

You network setup seems odd and not align with our rework doc.

Please purge Maas package reboot and restart if you can or send us your
network configuration.

Le dim. 14 juin 2015 07:00, Zhanglei Mao <email address hidden> a
écrit :

> Test it on Ubuntu 14.04.2 X64 server + MAAS 1.8 and Ubuntu 14.04.2 X64
> Desktop + MAAS 1.7, both are stop at:
>
> + run-one-until-success maas admin node-group-interface update
> 3b3deac8-ce39-4fb6-b0a2-74ab32474fce br0 ip_range_low=172.27.9.1
> ip_range_high=172.27.9.254 static_ip_range_low=172.27.10.1
> static_ip_range_high=172.27.10.254 management=2 broadcast_ip=172.27.11.255
> router_ip=172.27.8.1
> Not FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot
> FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot FoundNot
> FoundNot FoundNot FoundNot FoundNot Found^Cdpkg: error processing package
> orange-box (--configure):
> subprocess installed post-installation script was interrupted
> E: Sub-process /usr/bin/dpkg exited unexpectedly
> W: Operation was interrupted before it could finish
>
> The problem seems of matching in "br0" and "eth1"
>
> ubuntu@OrangeBox8:~$ sudo maas admin node-groups list
> Success.
> Machine-readable output follows:
> [
> {
> "cluster_name": "Cluster master",
> "status": 1,
> "name": "maas",
> "uuid": "3b3deac8-ce39-4fb6-b0a2-74ab32474fce"
> }
> ]
> ubuntu@OrangeBox8:~$ sudo maas admin node-group-interfaces list
> 3b3deac8-ce39-4fb6-b0a2-74ab32474fce
> Success.
> Machine-readable output follows:
> [
> {
> "ip_range_high": null,
> "ip_range_low": null,
> "broadcast_ip": "172.27.255.255",
> "static_ip_range_low": null,
> "name": "eth1",
> "ip": "172.27.252.8",
> "subnet_mask": "255.255.252.0",
> "management": 0,
> "static_ip_range_high": null,
> "interface": "eth1"
> }
> ]
>
> It cab update as below:
>
> ubuntu@OrangeBox8:~$ sudo maas admin node-group-interface update
> 3b3deac8-ce39-4fb6-b0a2-74ab32474fce eth1 ip_range_low=172.27.9.1
> ip_range_high=172.27.9.254 static_ip_range_low=172.27.10.1
> static_ip_range_high=172.27.10.254 management=2 broadcast_ip=172.27.11.255
> router_ip=172.27.8.1
> {"ip_range_high": ["172.27.9.254 not in the 172.27.252.0/22 network"],
> "ip_range_low": ["172.27.9.1 not in the 172.27.252.0/22 network"],
> "broadcast_ip": ["172.27.11.255 not in the 172.27.252.0/22 network"],
> "static_ip_range_low": ["172.27.10.1 not in the 172.27.252.0/22
> network"], "router_ip": ["172.27.8.1 not in the 172.27.252.0/22
> network"], "static_ip_range_high": ["172.27.10.254 not in the
> 172.27.252.0/22 network"]}
>
> The br0 interface seem correct, but I didn't command which created the
> interface listed by the command of '$ sudo maas admin node-group-interfaces
> list 3b3deac8-ce39-4fb6-b0a2-74ab32474fce'
>
> --
> https://code.launchpad.net/~thomnico/orange-box/newnet/+merge/261775
> You are the owner of lp:~thomnico/orange-box/newnet.
>

Revision history for this message
Zhanglei Mao (zhanglei-mao) wrote :
Download full text (6.2 KiB)

Nicolas,

I agree. It should be caused by the problem of my network. Here is output
of ifconfig and brctl. The eth1 is my usb-lan-card port, eth0 is system
board lan-card port. I configured eth1 with 172.27.252.8 and was able to
reach internet via gateway of 172.27.252.1 before running #apt-get install
orange-box.

ubuntu@OrangeBox8:~$ ifconfig
br0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
          inet addr:172.27.8.1 Bcast:172.27.11.255 Mask:255.255.252.0
          inet6 addr: fe80::eea8:6bff:fefe:1822/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B) TX bytes:7671 (7.6 KB)

eth0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B) TX bytes:8015 (8.0 KB)
          Interrupt:20 Memory:f7d00000-f7d20000

eth1 Link encap:Ethernet HWaddr 00:24:9b:0e:1e:ad
          inet addr:172.27.252.8 Bcast:172.27.255.255 Mask:255.255.252.0
          inet6 addr: fe80::224:9bff:fe0e:1ead/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:9734872 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5699043 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:14599384523 (14.5 GB) TX bytes:443971610 (443.9 MB)

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:65536 Metric:1
          RX packets:107516 errors:0 dropped:0 overruns:0 frame:0
          TX packets:107516 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:27072199 (27.0 MB) TX bytes:27072199 (27.0 MB)

virbr0 Link encap:Ethernet HWaddr da:cf:d4:c0:b0:b7
          inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
          UP BROADCAST MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

ubuntu@OrangeBox8:~$

ubuntu@OrangeBox8:~$ brctl show
bridge name bridge id STP enabled interfaces
br0 8000.eca86bfe1822 no eth0
virbr0 8000.000000000000 yes

thanks,
Mao

On Sun, Jun 14, 2015 at 5:15 PM, Nicolas Thomas <
<email address hidden>> wrote:

> Mao,
>
> You network setup seems odd and not align with our rework doc.
>
> Please purge Maas package reboot and restart if you can or send us your
> network configuration.
>
> Le dim. 14 juin 2015 07:00, Zhanglei Mao <email address hidden> a
> écrit :
>
> > Test it on Ubuntu 14.04.2 X64 server + MAAS 1.8 and Ubuntu 14.04.2 X64
> > Desktop + MAAS 1.7, both are stop at:
> >
> > + run-o...

Read more...

Revision history for this message
Nicolas Thomas (thomnico) wrote :
Download full text (6.7 KiB)

Hello Mao,

With a laptop keyboard (not a phone) this time:

Your network setup should show em1 and not eth0 .. (might not be related).

Can you run :
sudo biosdevname -i eth1

And rerun the install package to confirm ??

My Box seems totally dead now (node0) so difficult to confirm

On 14/06/2015 12:54, Zhanglei Mao wrote:
> Nicolas,
>
> I agree. It should be caused by the problem of my network. Here is output
> of ifconfig and brctl. The eth1 is my usb-lan-card port, eth0 is system
> board lan-card port. I configured eth1 with 172.27.252.8 and was able to
> reach internet via gateway of 172.27.252.1 before running #apt-get install
> orange-box.
>
> ubuntu@OrangeBox8:~$ ifconfig
> br0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
> inet addr:172.27.8.1 Bcast:172.27.11.255 Mask:255.255.252.0
> inet6 addr: fe80::eea8:6bff:fefe:1822/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:0 (0.0 B) TX bytes:7671 (7.6 KB)
>
> eth0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:0 (0.0 B) TX bytes:8015 (8.0 KB)
> Interrupt:20 Memory:f7d00000-f7d20000
>
> eth1 Link encap:Ethernet HWaddr 00:24:9b:0e:1e:ad
> inet addr:172.27.252.8 Bcast:172.27.255.255 Mask:255.255.252.0
> inet6 addr: fe80::224:9bff:fe0e:1ead/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:9734872 errors:0 dropped:0 overruns:0 frame:0
> TX packets:5699043 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:14599384523 (14.5 GB) TX bytes:443971610 (443.9 MB)
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> inet6 addr: ::1/128 Scope:Host
> UP LOOPBACK RUNNING MTU:65536 Metric:1
> RX packets:107516 errors:0 dropped:0 overruns:0 frame:0
> TX packets:107516 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:27072199 (27.0 MB) TX bytes:27072199 (27.0 MB)
>
> virbr0 Link encap:Ethernet HWaddr da:cf:d4:c0:b0:b7
> inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
> UP BROADCAST MULTICAST MTU:1500 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
>
> ubuntu@OrangeBox8:~$
>
> ubuntu@OrangeBox8:~$ brctl show
> bridge name bridge id STP enabled interfaces
> br0 8000.eca86bfe1822 no eth0
> virbr0 8000.000000000000 yes
>
> thanks,
> Mao
>
> On Sun, Jun 14, 2015 at 5:15 P...

Read more...

lp:~thomnico/orange-box/newnet updated
540. By Nicolas Thomas

* Add biosdevname cmd in scripts
* Add a check/heal for VMs powermanagement ssh keys
*

Revision history for this message
Nicolas Thomas (thomnico) wrote :
Download full text (7.4 KiB)

Mao / all

I upload a 2.9 version to experimental ppa that should fix the pb and
the VM power issues we might face time to time..

Will restart a review on that one

On Mon, Jun 15, 2015 at 9:12 AM, Nicolas Thomas
<email address hidden> wrote:
> Hello Mao,
>
> With a laptop keyboard (not a phone) this time:
>
> Your network setup should show em1 and not eth0 .. (might not be related).
>
> Can you run :
> sudo biosdevname -i eth1
>
> And rerun the install package to confirm ??
>
> My Box seems totally dead now (node0) so difficult to confirm
>
>
> On 14/06/2015 12:54, Zhanglei Mao wrote:
>> Nicolas,
>>
>> I agree. It should be caused by the problem of my network. Here is output
>> of ifconfig and brctl. The eth1 is my usb-lan-card port, eth0 is system
>> board lan-card port. I configured eth1 with 172.27.252.8 and was able to
>> reach internet via gateway of 172.27.252.1 before running #apt-get install
>> orange-box.
>>
>> ubuntu@OrangeBox8:~$ ifconfig
>> br0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
>> inet addr:172.27.8.1 Bcast:172.27.11.255 Mask:255.255.252.0
>> inet6 addr: fe80::eea8:6bff:fefe:1822/64 Scope:Link
>> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>> TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
>> collisions:0 txqueuelen:0
>> RX bytes:0 (0.0 B) TX bytes:7671 (7.6 KB)
>>
>> eth0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
>> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>> TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
>> collisions:0 txqueuelen:1000
>> RX bytes:0 (0.0 B) TX bytes:8015 (8.0 KB)
>> Interrupt:20 Memory:f7d00000-f7d20000
>>
>> eth1 Link encap:Ethernet HWaddr 00:24:9b:0e:1e:ad
>> inet addr:172.27.252.8 Bcast:172.27.255.255 Mask:255.255.252.0
>> inet6 addr: fe80::224:9bff:fe0e:1ead/64 Scope:Link
>> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>> RX packets:9734872 errors:0 dropped:0 overruns:0 frame:0
>> TX packets:5699043 errors:0 dropped:0 overruns:0 carrier:0
>> collisions:0 txqueuelen:1000
>> RX bytes:14599384523 (14.5 GB) TX bytes:443971610 (443.9 MB)
>>
>> lo Link encap:Local Loopback
>> inet addr:127.0.0.1 Mask:255.0.0.0
>> inet6 addr: ::1/128 Scope:Host
>> UP LOOPBACK RUNNING MTU:65536 Metric:1
>> RX packets:107516 errors:0 dropped:0 overruns:0 frame:0
>> TX packets:107516 errors:0 dropped:0 overruns:0 carrier:0
>> collisions:0 txqueuelen:0
>> RX bytes:27072199 (27.0 MB) TX bytes:27072199 (27.0 MB)
>>
>> virbr0 Link encap:Ethernet HWaddr da:cf:d4:c0:b0:b7
>> inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
>> UP BROADCAST MULTICAST MTU:1500 Metric:1
>> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>> collisions:0 txqueuelen:...

Read more...

lp:~thomnico/orange-box/newnet updated
541. By Nicolas Thomas

releasing 2.8~ppa1

542. By Nicolas Thomas

releasing 2.9~ppa1

543. By Nicolas Thomas

Update source/format so zbr-buildpackages works
make ssh works correctly in add-virutal-nodes

modified:
  debian/source/format
  usr/bin/orange-box-add-virtual-nodes

544. By Nicolas Thomas

releasing 2.9~ppa2

545. By Nicolas Thomas

updates on ssh maas to ubuntu automation

modified:
  debian/changelog
  usr/bin/orange-box-add-virtual-nodes

Revision history for this message
Zhanglei Mao (zhanglei-mao) wrote :
Download full text (9.2 KiB)

Nicolas,

No sure I have used the new version you had uploaded. I test it again, it
stop at same step of "Not Found". I check the GUI, both the eth1 network
and eth1 interface were created. I delete it from the GUI and rerun the
'dpkg --configure -a' again, still get "Not Found"

In the MAAS document, this interface seems was created automatically. So it
should related to my network. Here is my rough steps for test:
1)To setup 14.04.2 X86 Desktop without network from usb stick. The hostname
set to OrangeBox8 and region is to Hongkong.
2)After install finish, I mount /srv and change locale and set eth1 static
ip via network manager.
3)install biosnamedev and reboot. The eth0 will be em1 now.
4)Add rep and install ornage-box as below:
sudo apt-add-repository ppa:maas-maintainers/stable
sudo add-apt-repository ppa:orange-box/experimental
sudo apt-add-repository ppa:juju/stable
sudo apt-get update
sudo apt-get -V install orange-box | tee /var/log/$(hostname)_log.txt

thanks,
Mao

On Mon, Jun 15, 2015 at 5:00 PM, Nicolas Thomas <
<email address hidden>> wrote:

> Mao / all
>
> I upload a 2.9 version to experimental ppa that should fix the pb and
> the VM power issues we might face time to time..
>
> Will restart a review on that one
>
>
> On Mon, Jun 15, 2015 at 9:12 AM, Nicolas Thomas
> <email address hidden> wrote:
> > Hello Mao,
> >
> > With a laptop keyboard (not a phone) this time:
> >
> > Your network setup should show em1 and not eth0 .. (might not be
> related).
> >
> > Can you run :
> > sudo biosdevname -i eth1
> >
> > And rerun the install package to confirm ??
> >
> > My Box seems totally dead now (node0) so difficult to confirm
> >
> >
> > On 14/06/2015 12:54, Zhanglei Mao wrote:
> >> Nicolas,
> >>
> >> I agree. It should be caused by the problem of my network. Here is
> output
> >> of ifconfig and brctl. The eth1 is my usb-lan-card port, eth0 is system
> >> board lan-card port. I configured eth1 with 172.27.252.8 and was able to
> >> reach internet via gateway of 172.27.252.1 before running #apt-get
> install
> >> orange-box.
> >>
> >> ubuntu@OrangeBox8:~$ ifconfig
> >> br0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
> >> inet addr:172.27.8.1 Bcast:172.27.11.255 Mask:255.255.252.0
> >> inet6 addr: fe80::eea8:6bff:fefe:1822/64 Scope:Link
> >> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> >> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> >> TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
> >> collisions:0 txqueuelen:0
> >> RX bytes:0 (0.0 B) TX bytes:7671 (7.6 KB)
> >>
> >> eth0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
> >> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> >> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> >> TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
> >> collisions:0 txqueuelen:1000
> >> RX bytes:0 (0.0 B) TX bytes:8015 (8.0 KB)
> >> Interrupt:20 Memory:f7d00000-f7d20000
> >>
> >> eth1 Link encap:Ethernet HWaddr 00:24:9b:0e:1e:ad
> >> inet addr:172.27.252.8 Bcast:172.27.255.255
> Mask:255.255.252.0...

Read more...

Revision history for this message
Nicolas Thomas (thomnico) wrote :
Download full text (10.0 KiB)

You should not have eth0 !

Please purge maas, do an update and reinstall to confirm .

On Mon, Jun 15, 2015 at 3:54 PM, Zhanglei Mao
<email address hidden> wrote:
> Nicolas,
>
> No sure I have used the new version you had uploaded. I test it again, it
> stop at same step of "Not Found". I check the GUI, both the eth1 network
> and eth1 interface were created. I delete it from the GUI and rerun the
> 'dpkg --configure -a' again, still get "Not Found"
>
> In the MAAS document, this interface seems was created automatically. So it
> should related to my network. Here is my rough steps for test:
> 1)To setup 14.04.2 X86 Desktop without network from usb stick. The hostname
> set to OrangeBox8 and region is to Hongkong.
> 2)After install finish, I mount /srv and change locale and set eth1 static
> ip via network manager.
> 3)install biosnamedev and reboot. The eth0 will be em1 now.
> 4)Add rep and install ornage-box as below:
> sudo apt-add-repository ppa:maas-maintainers/stable
> sudo add-apt-repository ppa:orange-box/experimental
> sudo apt-add-repository ppa:juju/stable
> sudo apt-get update
> sudo apt-get -V install orange-box | tee /var/log/$(hostname)_log.txt
>
>
> thanks,
> Mao
>
> On Mon, Jun 15, 2015 at 5:00 PM, Nicolas Thomas <
> <email address hidden>> wrote:
>
>> Mao / all
>>
>> I upload a 2.9 version to experimental ppa that should fix the pb and
>> the VM power issues we might face time to time..
>>
>> Will restart a review on that one
>>
>>
>> On Mon, Jun 15, 2015 at 9:12 AM, Nicolas Thomas
>> <email address hidden> wrote:
>> > Hello Mao,
>> >
>> > With a laptop keyboard (not a phone) this time:
>> >
>> > Your network setup should show em1 and not eth0 .. (might not be
>> related).
>> >
>> > Can you run :
>> > sudo biosdevname -i eth1
>> >
>> > And rerun the install package to confirm ??
>> >
>> > My Box seems totally dead now (node0) so difficult to confirm
>> >
>> >
>> > On 14/06/2015 12:54, Zhanglei Mao wrote:
>> >> Nicolas,
>> >>
>> >> I agree. It should be caused by the problem of my network. Here is
>> output
>> >> of ifconfig and brctl. The eth1 is my usb-lan-card port, eth0 is system
>> >> board lan-card port. I configured eth1 with 172.27.252.8 and was able to
>> >> reach internet via gateway of 172.27.252.1 before running #apt-get
>> install
>> >> orange-box.
>> >>
>> >> ubuntu@OrangeBox8:~$ ifconfig
>> >> br0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
>> >> inet addr:172.27.8.1 Bcast:172.27.11.255 Mask:255.255.252.0
>> >> inet6 addr: fe80::eea8:6bff:fefe:1822/64 Scope:Link
>> >> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>> >> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>> >> TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
>> >> collisions:0 txqueuelen:0
>> >> RX bytes:0 (0.0 B) TX bytes:7671 (7.6 KB)
>> >>
>> >> eth0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
>> >> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>> >> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>> >> TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
>> >> collisions:0 tx...

Revision history for this message
Zhanglei Mao (zhanglei-mao) wrote :
Download full text (10.8 KiB)

Yes, no eth0 anymore. I gonna test it again Tomorrow.
2015年6月15日 下午10:09于 "Nicolas Thomas" <email address hidden>写道:

> You should not have eth0 !
>
> Please purge maas, do an update and reinstall to confirm .
>
> On Mon, Jun 15, 2015 at 3:54 PM, Zhanglei Mao
> <email address hidden> wrote:
> > Nicolas,
> >
> > No sure I have used the new version you had uploaded. I test it again, it
> > stop at same step of "Not Found". I check the GUI, both the eth1 network
> > and eth1 interface were created. I delete it from the GUI and rerun the
> > 'dpkg --configure -a' again, still get "Not Found"
> >
> > In the MAAS document, this interface seems was created automatically. So
> it
> > should related to my network. Here is my rough steps for test:
> > 1)To setup 14.04.2 X86 Desktop without network from usb stick. The
> hostname
> > set to OrangeBox8 and region is to Hongkong.
> > 2)After install finish, I mount /srv and change locale and set eth1
> static
> > ip via network manager.
> > 3)install biosnamedev and reboot. The eth0 will be em1 now.
> > 4)Add rep and install ornage-box as below:
> > sudo apt-add-repository ppa:maas-maintainers/stable
> > sudo add-apt-repository ppa:orange-box/experimental
> > sudo apt-add-repository ppa:juju/stable
> > sudo apt-get update
> > sudo apt-get -V install orange-box | tee /var/log/$(hostname)_log.txt
> >
> >
> > thanks,
> > Mao
> >
> > On Mon, Jun 15, 2015 at 5:00 PM, Nicolas Thomas <
> > <email address hidden>> wrote:
> >
> >> Mao / all
> >>
> >> I upload a 2.9 version to experimental ppa that should fix the pb and
> >> the VM power issues we might face time to time..
> >>
> >> Will restart a review on that one
> >>
> >>
> >> On Mon, Jun 15, 2015 at 9:12 AM, Nicolas Thomas
> >> <email address hidden> wrote:
> >> > Hello Mao,
> >> >
> >> > With a laptop keyboard (not a phone) this time:
> >> >
> >> > Your network setup should show em1 and not eth0 .. (might not be
> >> related).
> >> >
> >> > Can you run :
> >> > sudo biosdevname -i eth1
> >> >
> >> > And rerun the install package to confirm ??
> >> >
> >> > My Box seems totally dead now (node0) so difficult to confirm
> >> >
> >> >
> >> > On 14/06/2015 12:54, Zhanglei Mao wrote:
> >> >> Nicolas,
> >> >>
> >> >> I agree. It should be caused by the problem of my network. Here is
> >> output
> >> >> of ifconfig and brctl. The eth1 is my usb-lan-card port, eth0 is
> system
> >> >> board lan-card port. I configured eth1 with 172.27.252.8 and was
> able to
> >> >> reach internet via gateway of 172.27.252.1 before running #apt-get
> >> install
> >> >> orange-box.
> >> >>
> >> >> ubuntu@OrangeBox8:~$ ifconfig
> >> >> br0 Link encap:Ethernet HWaddr ec:a8:6b:fe:18:22
> >> >> inet addr:172.27.8.1 Bcast:172.27.11.255
> Mask:255.255.252.0
> >> >> inet6 addr: fe80::eea8:6bff:fefe:1822/64 Scope:Link
> >> >> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> >> >> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> >> >> TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
> >> >> collisions:0 txqueuelen:0
> >> >> RX bytes:0 (0.0 B) TX bytes:7671 (7.6 KB)
> >> >>
> ...

Revision history for this message
Zhanglei Mao (zhanglei-mao) wrote :
Download full text (12.6 KiB)

Nicolas,

I though the right logic might as:
1) preinst script of the orange-box -- adjust network according
2) maas packages install --auto create mas-cluster-interfaces
3) postinst script of the orange-box

But it was actually happened as:
1)maas pacakge install ( in case of deps by ornage-box)
2)preinst script of the orange-box
3)postinst script of the orange-box

So this is cause that unnecessary interfaces was added by maas during
install. There seems no easy method to let network setup scripts runs
before the maas. So we may just delete all interface added by maas
automatically and create br0 interface inside the orange-box postinst
scripts.

thanks,
Mao

On Mon, Jun 15, 2015 at 10:21 PM, Zhanglei Mao <email address hidden>
wrote:

> Yes, no eth0 anymore. I gonna test it again Tomorrow.
> 2015年6月15日 下午10:09于 "Nicolas Thomas" <email address hidden>写道:
>
> > You should not have eth0 !
> >
> > Please purge maas, do an update and reinstall to confirm .
> >
> > On Mon, Jun 15, 2015 at 3:54 PM, Zhanglei Mao
> > <email address hidden> wrote:
> > > Nicolas,
> > >
> > > No sure I have used the new version you had uploaded. I test it again,
> it
> > > stop at same step of "Not Found". I check the GUI, both the eth1
> network
> > > and eth1 interface were created. I delete it from the GUI and rerun the
> > > 'dpkg --configure -a' again, still get "Not Found"
> > >
> > > In the MAAS document, this interface seems was created automatically.
> So
> > it
> > > should related to my network. Here is my rough steps for test:
> > > 1)To setup 14.04.2 X86 Desktop without network from usb stick. The
> > hostname
> > > set to OrangeBox8 and region is to Hongkong.
> > > 2)After install finish, I mount /srv and change locale and set eth1
> > static
> > > ip via network manager.
> > > 3)install biosnamedev and reboot. The eth0 will be em1 now.
> > > 4)Add rep and install ornage-box as below:
> > > sudo apt-add-repository ppa:maas-maintainers/stable
> > > sudo add-apt-repository ppa:orange-box/experimental
> > > sudo apt-add-repository ppa:juju/stable
> > > sudo apt-get update
> > > sudo apt-get -V install orange-box | tee /var/log/$(hostname)_log.txt
> > >
> > >
> > > thanks,
> > > Mao
> > >
> > > On Mon, Jun 15, 2015 at 5:00 PM, Nicolas Thomas <
> > > <email address hidden>> wrote:
> > >
> > >> Mao / all
> > >>
> > >> I upload a 2.9 version to experimental ppa that should fix the pb and
> > >> the VM power issues we might face time to time..
> > >>
> > >> Will restart a review on that one
> > >>
> > >>
> > >> On Mon, Jun 15, 2015 at 9:12 AM, Nicolas Thomas
> > >> <email address hidden> wrote:
> > >> > Hello Mao,
> > >> >
> > >> > With a laptop keyboard (not a phone) this time:
> > >> >
> > >> > Your network setup should show em1 and not eth0 .. (might not be
> > >> related).
> > >> >
> > >> > Can you run :
> > >> > sudo biosdevname -i eth1
> > >> >
> > >> > And rerun the install package to confirm ??
> > >> >
> > >> > My Box seems totally dead now (node0) so difficult to confirm
> > >> >
> > >> >
> > >> > On 14/06/2015 12:54, Zhanglei Mao wrote:
> > >> >> Nicolas,
> > >> >>
> > >> >> I agree. It should be caused by the prob...

Revision history for this message
Nicolas Thomas (thomnico) wrote :
Download full text (13.5 KiB)

That was not the intent to change behavior yet .. intent is to have a
common baseline for enhancing as a team.

Procedure is : orange-box-purge-everything , reboot , apt-get install orange-box

If you don't like the sequence propose a branch :)

On Wed, Jun 17, 2015 at 4:12 PM, Zhanglei Mao
<email address hidden> wrote:
> Nicolas,
>
> I though the right logic might as:
> 1) preinst script of the orange-box -- adjust network according
> 2) maas packages install --auto create mas-cluster-interfaces
> 3) postinst script of the orange-box
>
> But it was actually happened as:
> 1)maas pacakge install ( in case of deps by ornage-box)
> 2)preinst script of the orange-box
> 3)postinst script of the orange-box
>
> So this is cause that unnecessary interfaces was added by maas during
> install. There seems no easy method to let network setup scripts runs
> before the maas. So we may just delete all interface added by maas
> automatically and create br0 interface inside the orange-box postinst
> scripts.
>
> thanks,
> Mao
>
>
> On Mon, Jun 15, 2015 at 10:21 PM, Zhanglei Mao <email address hidden>
> wrote:
>
>> Yes, no eth0 anymore. I gonna test it again Tomorrow.
>> 2015年6月15日 下午10:09于 "Nicolas Thomas" <email address hidden>写道:
>>
>> > You should not have eth0 !
>> >
>> > Please purge maas, do an update and reinstall to confirm .
>> >
>> > On Mon, Jun 15, 2015 at 3:54 PM, Zhanglei Mao
>> > <email address hidden> wrote:
>> > > Nicolas,
>> > >
>> > > No sure I have used the new version you had uploaded. I test it again,
>> it
>> > > stop at same step of "Not Found". I check the GUI, both the eth1
>> network
>> > > and eth1 interface were created. I delete it from the GUI and rerun the
>> > > 'dpkg --configure -a' again, still get "Not Found"
>> > >
>> > > In the MAAS document, this interface seems was created automatically.
>> So
>> > it
>> > > should related to my network. Here is my rough steps for test:
>> > > 1)To setup 14.04.2 X86 Desktop without network from usb stick. The
>> > hostname
>> > > set to OrangeBox8 and region is to Hongkong.
>> > > 2)After install finish, I mount /srv and change locale and set eth1
>> > static
>> > > ip via network manager.
>> > > 3)install biosnamedev and reboot. The eth0 will be em1 now.
>> > > 4)Add rep and install ornage-box as below:
>> > > sudo apt-add-repository ppa:maas-maintainers/stable
>> > > sudo add-apt-repository ppa:orange-box/experimental
>> > > sudo apt-add-repository ppa:juju/stable
>> > > sudo apt-get update
>> > > sudo apt-get -V install orange-box | tee /var/log/$(hostname)_log.txt
>> > >
>> > >
>> > > thanks,
>> > > Mao
>> > >
>> > > On Mon, Jun 15, 2015 at 5:00 PM, Nicolas Thomas <
>> > > <email address hidden>> wrote:
>> > >
>> > >> Mao / all
>> > >>
>> > >> I upload a 2.9 version to experimental ppa that should fix the pb and
>> > >> the VM power issues we might face time to time..
>> > >>
>> > >> Will restart a review on that one
>> > >>
>> > >>
>> > >> On Mon, Jun 15, 2015 at 9:12 AM, Nicolas Thomas
>> > >> <email address hidden> wrote:
>> > >> > Hello Mao,
>> > >> >
>> > >> > With a laptop keyboard (not a phone) this time:
>> > >> >
>> > >> > Your ne...

Revision history for this message
Zhanglei Mao (zhanglei-mao) wrote :
Download full text (15.5 KiB)

Procedure is : orange-box-purge-everything , reboot , apt-get install
orange-box

Yes, it works at last. But I have to say it is not easy.

The rough steps are:
sudo apt-get purge maas-cluster-controller
sudo apt-get purge maas-region-controller python-django-maas
sudo apt-get purge maas-proxy
sudo apt-get purge maas orange-box
sudo apt-get autoremove
#reboot
sudo apt-get install

during the process you may need to:
sudo rm /etc/apache2/conf-enabled//maas-cluster-http.conf
/etc/apache2/conf-enabled/maas-http.conf (if apache start failed)
sudo cat id_rsa.pub >> /home/ubuntu/.ssh/authorized_keys (if error caused
by not exist of this file)
sudo apachectl start (if apache restart failed)

I didn't verify above and may test it again after back from trip and share
it next week.

thanks,
Mao

On Wed, Jun 17, 2015 at 11:51 PM, Nicolas Thomas <
<email address hidden>> wrote:

> That was not the intent to change behavior yet .. intent is to have a
> common baseline for enhancing as a team.
>
> Procedure is : orange-box-purge-everything , reboot , apt-get install
> orange-box
>
> If you don't like the sequence propose a branch :)
>
>
> On Wed, Jun 17, 2015 at 4:12 PM, Zhanglei Mao
> <email address hidden> wrote:
> > Nicolas,
> >
> > I though the right logic might as:
> > 1) preinst script of the orange-box -- adjust network according
> > 2) maas packages install --auto create mas-cluster-interfaces
> > 3) postinst script of the orange-box
> >
> > But it was actually happened as:
> > 1)maas pacakge install ( in case of deps by ornage-box)
> > 2)preinst script of the orange-box
> > 3)postinst script of the orange-box
> >
> > So this is cause that unnecessary interfaces was added by maas during
> > install. There seems no easy method to let network setup scripts runs
> > before the maas. So we may just delete all interface added by maas
> > automatically and create br0 interface inside the orange-box postinst
> > scripts.
> >
> > thanks,
> > Mao
> >
> >
> > On Mon, Jun 15, 2015 at 10:21 PM, Zhanglei Mao <
> <email address hidden>>
> > wrote:
> >
> >> Yes, no eth0 anymore. I gonna test it again Tomorrow.
> >> 2015年6月15日 下午10:09于 "Nicolas Thomas" <email address hidden>写道:
> >>
> >> > You should not have eth0 !
> >> >
> >> > Please purge maas, do an update and reinstall to confirm .
> >> >
> >> > On Mon, Jun 15, 2015 at 3:54 PM, Zhanglei Mao
> >> > <email address hidden> wrote:
> >> > > Nicolas,
> >> > >
> >> > > No sure I have used the new version you had uploaded. I test it
> again,
> >> it
> >> > > stop at same step of "Not Found". I check the GUI, both the eth1
> >> network
> >> > > and eth1 interface were created. I delete it from the GUI and rerun
> the
> >> > > 'dpkg --configure -a' again, still get "Not Found"
> >> > >
> >> > > In the MAAS document, this interface seems was created
> automatically.
> >> So
> >> > it
> >> > > should related to my network. Here is my rough steps for test:
> >> > > 1)To setup 14.04.2 X86 Desktop without network from usb stick. The
> >> > hostname
> >> > > set to OrangeBox8 and region is to Hongkong.
> >> > > 2)After install finish, I mount /srv and change locale and set eth1
> >> > stat...

Revision history for this message
Nicolas Thomas (thomnico) wrote :
Download full text (17.0 KiB)

Mao

: orange-box-purge-everything , is a CLI to do the cleanup.

I disagree that reordering will change anything.. If maas is there and set
up differently than what orange box expect we must stop and raise an issue
... I do not want to end up with unnoticed change of this nature...

On a side note purging Maas is painfull due to Maas packaging and we should
log bugs on those
Le 18 juin 2015 07:00, "Zhanglei Mao" <email address hidden> a écrit :

> Procedure is : orange-box-purge-everything , reboot , apt-get install
> orange-box
>
> Yes, it works at last. But I have to say it is not easy.
>
> The rough steps are:
> sudo apt-get purge maas-cluster-controller
> sudo apt-get purge maas-region-controller python-django-maas
> sudo apt-get purge maas-proxy
> sudo apt-get purge maas orange-box
> sudo apt-get autoremove
> #reboot
> sudo apt-get install
>
> during the process you may need to:
> sudo rm /etc/apache2/conf-enabled//maas-cluster-http.conf
> /etc/apache2/conf-enabled/maas-http.conf (if apache start failed)
> sudo cat id_rsa.pub >> /home/ubuntu/.ssh/authorized_keys (if error caused
> by not exist of this file)
> sudo apachectl start (if apache restart failed)
>
> I didn't verify above and may test it again after back from trip and share
> it next week.
>
> thanks,
> Mao
>
>
> On Wed, Jun 17, 2015 at 11:51 PM, Nicolas Thomas <
> <email address hidden>> wrote:
>
> > That was not the intent to change behavior yet .. intent is to have a
> > common baseline for enhancing as a team.
> >
> > Procedure is : orange-box-purge-everything , reboot , apt-get install
> > orange-box
> >
> > If you don't like the sequence propose a branch :)
> >
> >
> > On Wed, Jun 17, 2015 at 4:12 PM, Zhanglei Mao
> > <email address hidden> wrote:
> > > Nicolas,
> > >
> > > I though the right logic might as:
> > > 1) preinst script of the orange-box -- adjust network according
> > > 2) maas packages install --auto create mas-cluster-interfaces
> > > 3) postinst script of the orange-box
> > >
> > > But it was actually happened as:
> > > 1)maas pacakge install ( in case of deps by ornage-box)
> > > 2)preinst script of the orange-box
> > > 3)postinst script of the orange-box
> > >
> > > So this is cause that unnecessary interfaces was added by maas during
> > > install. There seems no easy method to let network setup scripts runs
> > > before the maas. So we may just delete all interface added by maas
> > > automatically and create br0 interface inside the orange-box postinst
> > > scripts.
> > >
> > > thanks,
> > > Mao
> > >
> > >
> > > On Mon, Jun 15, 2015 at 10:21 PM, Zhanglei Mao <
> > <email address hidden>>
> > > wrote:
> > >
> > >> Yes, no eth0 anymore. I gonna test it again Tomorrow.
> > >> 2015年6月15日 下午10:09于 "Nicolas Thomas" <<email address hidden>
> >写道:
> > >>
> > >> > You should not have eth0 !
> > >> >
> > >> > Please purge maas, do an update and reinstall to confirm .
> > >> >
> > >> > On Mon, Jun 15, 2015 at 3:54 PM, Zhanglei Mao
> > >> > <email address hidden> wrote:
> > >> > > Nicolas,
> > >> > >
> > >> > > No sure I have used the new version you had uploaded. I test it
> > again,
> > >> it
> > >> > > stop at same step o...

Revision history for this message
Zhanglei Mao (zhanglei-mao) wrote :
Download full text (18.5 KiB)

Nicolas,

I didn't realise it is a CLI command can used directly :-). It will be a
bit easy now.

thanks,

On Fri, Jun 19, 2015 at 2:51 AM, Nicolas Thomas <
<email address hidden>> wrote:

> Mao
>
> : orange-box-purge-everything , is a CLI to do the cleanup.
>
> I disagree that reordering will change anything.. If maas is there and set
> up differently than what orange box expect we must stop and raise an issue
> ... I do not want to end up with unnoticed change of this nature...
>
> On a side note purging Maas is painfull due to Maas packaging and we should
> log bugs on those
> Le 18 juin 2015 07:00, "Zhanglei Mao" <email address hidden> a
> écrit :
>
> > Procedure is : orange-box-purge-everything , reboot , apt-get install
> > orange-box
> >
> > Yes, it works at last. But I have to say it is not easy.
> >
> > The rough steps are:
> > sudo apt-get purge maas-cluster-controller
> > sudo apt-get purge maas-region-controller python-django-maas
> > sudo apt-get purge maas-proxy
> > sudo apt-get purge maas orange-box
> > sudo apt-get autoremove
> > #reboot
> > sudo apt-get install
> >
> > during the process you may need to:
> > sudo rm /etc/apache2/conf-enabled//maas-cluster-http.conf
> > /etc/apache2/conf-enabled/maas-http.conf (if apache start failed)
> > sudo cat id_rsa.pub >> /home/ubuntu/.ssh/authorized_keys (if error caused
> > by not exist of this file)
> > sudo apachectl start (if apache restart failed)
> >
> > I didn't verify above and may test it again after back from trip and
> share
> > it next week.
> >
> > thanks,
> > Mao
> >
> >
> > On Wed, Jun 17, 2015 at 11:51 PM, Nicolas Thomas <
> > <email address hidden>> wrote:
> >
> > > That was not the intent to change behavior yet .. intent is to have a
> > > common baseline for enhancing as a team.
> > >
> > > Procedure is : orange-box-purge-everything , reboot , apt-get install
> > > orange-box
> > >
> > > If you don't like the sequence propose a branch :)
> > >
> > >
> > > On Wed, Jun 17, 2015 at 4:12 PM, Zhanglei Mao
> > > <email address hidden> wrote:
> > > > Nicolas,
> > > >
> > > > I though the right logic might as:
> > > > 1) preinst script of the orange-box -- adjust network according
> > > > 2) maas packages install --auto create mas-cluster-interfaces
> > > > 3) postinst script of the orange-box
> > > >
> > > > But it was actually happened as:
> > > > 1)maas pacakge install ( in case of deps by ornage-box)
> > > > 2)preinst script of the orange-box
> > > > 3)postinst script of the orange-box
> > > >
> > > > So this is cause that unnecessary interfaces was added by maas during
> > > > install. There seems no easy method to let network setup scripts runs
> > > > before the maas. So we may just delete all interface added by maas
> > > > automatically and create br0 interface inside the orange-box postinst
> > > > scripts.
> > > >
> > > > thanks,
> > > > Mao
> > > >
> > > >
> > > > On Mon, Jun 15, 2015 at 10:21 PM, Zhanglei Mao <
> > > <email address hidden>>
> > > > wrote:
> > > >
> > > >> Yes, no eth0 anymore. I gonna test it again Tomorrow.
> > > >> 2015年6月15日 下午10:09于 "Nicolas Thomas" <<email address hidden>
> > >写道:
> > > >>
> > > >> > You ...

Revision history for this message
Nicolas Thomas (thomnico) wrote :

Per Dan request this working package/approach is discarded

review: Needs Information
lp:~thomnico/orange-box/newnet updated
546. By Nicolas Thomas

Fix zone issue
Fix ssh-keyscan for maas asking user intervention

547. By Nicolas Thomas

fix default to em1 for internal_interface

548. By Nicolas Thomas

Couple of fixes
Add code to avoid issue when no .ssh for ubuntu user is present.

549. By Nicolas Thomas

Remove entries to avoid conflicts

Unmerged revisions

549. By Nicolas Thomas

Remove entries to avoid conflicts

548. By Nicolas Thomas

Couple of fixes
Add code to avoid issue when no .ssh for ubuntu user is present.

547. By Nicolas Thomas

fix default to em1 for internal_interface

546. By Nicolas Thomas

Fix zone issue
Fix ssh-keyscan for maas asking user intervention

545. By Nicolas Thomas

updates on ssh maas to ubuntu automation

modified:
  debian/changelog
  usr/bin/orange-box-add-virtual-nodes

544. By Nicolas Thomas

releasing 2.9~ppa2

543. By Nicolas Thomas

Update source/format so zbr-buildpackages works
make ssh works correctly in add-virutal-nodes

modified:
  debian/source/format
  usr/bin/orange-box-add-virtual-nodes

542. By Nicolas Thomas

releasing 2.9~ppa1

541. By Nicolas Thomas

releasing 2.8~ppa1

540. By Nicolas Thomas

* Add biosdevname cmd in scripts
* Add a check/heal for VMs powermanagement ssh keys
*

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-01-21 22:04:42 +0000
3+++ debian/changelog 2015-07-21 17:58:26 +0000
4@@ -1,20 +1,66 @@
5-orange-box (1.90) unreleased; urgency=medium
6-
7- * etc/apt/orange-box-mirror.list, usr/bin/orange-box-create-package-
8- mirror:
9- - we're not currently using postmirror.sh, so set to /bin/true
10-
11- -- Dustin Kirkland <kirkland@ubuntu.com> Fri, 09 Jan 2015 11:13:51 -0600
12-
13-orange-box (1.89-0ubuntu1) vivid; urgency=medium
14-
15+orange-box (2.9ubuntu1~trusty) trusty; urgency=medium
16+
17+ * Change source/format for bzr-buildpackage to work
18+ * Fix issue with the ssh checking for power management of VMs
19+ *
20+ *
21+
22+ -- Nicolas Thomas <nicolas.thomas@canonical.com> Mon, 15 Jun 2015 13:32:06 +0200
23+
24+orange-box (2.9-0ubuntu1) trusty; urgency=medium
25+
26+ * Add biosdevname cmd in scripts
27+ * Add a check/heal for VMs powermanagement ssh keys
28+ *
29+
30+ -- Nicolas Thomas <nicolas.thomas@canonical.com> Mon, 15 Jun 2015 10:40:23 +0200
31+
32+orange-box (2.8ubuntu1~trusty-0ubuntu1) trusty; urgency=medium
33+
34+ [ Nicolas Thomas ]
35+ * Remove synccharmstore etc..
36+ * Adapt a number of changes to network setup etc..
37+ * Assume ob number in preinst and check in postinst in case network is not up
38+ * preinst bridgeutils
39+
40+ -- Nicolas Thomas <nicolas.thomas@canonical.com> Thu, 11 Jun 2015 20:59:08 +0200
41+
42+orange-box (2.7) trusty; urgency=medium
43+
44+ [ Takenori Matsumoto ]
45+ * usr/bin/orange-box-setup-nat:
46+ - Fix net.ipv4.conf.all.accept_redirects
47+ * usr/bin/orange-box-add-virtual-node
48+ - Fix Add maas's ssh key into /home/ubuntu/.ssh/authorized_keys so that MAAS can control power via virsh
49+
50+ -- Takenori Matsumoto <takenori.matsumoto@canonical.com> Fri, 02 May 2015 14:13:51 -0600
51+
52+orange-box (2.6) trusty; urgency=medium
53+
54+ [ Takenori Matsumoto ]
55+ * Re-write pachtes based on PPA (orange-box_1.89-0ubuntu1~trusty.debian.tar.xz, orange-box_1.89.orig.tar.gz) rather than trunk codes
56+
57+ [ takenori ]
58+ * usr/bin/orange-box-add-virtual-nodes:
59+ * usr/bin/orange-box-add-virtual-nodes:
60+ * usr/bin/orange-box-add-virtual-nodes:
61+ * :
62+
63+ -- Takenori Matsumoto <takenori.matsumoto@canonical.com> Fri, 02 May 2015 01:13:51 -0600
64+
65+orange-box (1.89-0ubuntu1~trusty) trusty; urgency=medium
66+
67+ [ Dustin Kirkland ]
68 * usr/bin/orange-box-bootstrap-juju:
69 - go back to --upload-tools, please keep this!
70 * usr/bin/orange-box-add-virtual-nodes:
71 - use ~maas rather than hard coding to /home/maas
72 + note that maas 1.7 has created a home directory in /var/lib/maas
73
74- -- Dustin Kirkland <kirkland@ubuntu.com> Fri, 09 Jan 2015 11:13:49 -0600
75+ [ takenori ]
76+ * :
77+
78+ -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 29 Oct 2014 09:58:53 -0500
79
80 orange-box (1.88-0ubuntu1) unstable; urgency=medium
81
82
83=== modified file 'debian/control'
84--- debian/control 2014-09-24 12:15:15 +0000
85+++ debian/control 2015-07-21 17:58:26 +0000
86@@ -9,7 +9,11 @@
87 Package: orange-box
88 Architecture: all
89 Pre-Depends:
90- run-one,
91+ run-one,
92+ maas,
93+ maas-cluster-controller,
94+ nmap,
95+ bridge-utils,
96 Depends: ${misc:Depends},
97 amtterm,
98 apache2,
99@@ -27,10 +31,7 @@
100 libglib2.0-bin,
101 libvirt-bin,
102 openssh-server,
103- maas,
104- maas-cluster-controller,
105 network-manager,
106- nmap,
107 pastebinit,
108 qemu-kvm,
109 remmina,
110@@ -43,6 +44,7 @@
111 vlan,
112 wsmancli,
113 x11vnc,
114+ biosdevname,
115 Recommends:
116 landscape-client,
117 python-keystone,
118
119=== added file 'debian/install'
120--- debian/install 1970-01-01 00:00:00 +0000
121+++ debian/install 2015-07-21 17:58:26 +0000
122@@ -0,0 +1,3 @@
123+etc/
124+home/
125+usr/
126
127=== modified file 'debian/links'
128--- debian/links 2014-05-08 23:10:25 +0000
129+++ debian/links 2015-07-21 17:58:26 +0000
130@@ -1,1 +1,1 @@
131-/usr/bin/orange-box-setup-nat /etc/network/if-up.d/orange-box-setup-nat
132+
133
134=== added file 'debian/postinst'
135--- debian/postinst 1970-01-01 00:00:00 +0000
136+++ debian/postinst 2015-07-21 17:58:26 +0000
137@@ -0,0 +1,331 @@
138+#!/bin/bash
139+
140+set -e
141+set -x
142+
143+PKG="orange-box"
144+RETRY=120
145+
146+. /usr/lib/orange-box/inc/common
147+. /etc/orange-box.conf
148+
149+check_orangebox_number() {
150+## be sure to wake AMT first give some time and ping again.
151+nmap -p 16992 -oG - 172.27.${orangebox_number}.11-20 > /dev/null
152+sleep 12
153+nmap -p 16992 -oG - 172.27.${orangebox_number}.11-20 > /dev/null
154+NUMAMTS=`nmap -p 16992 -oG - 172.27.${orangebox_number}.11-20 |grep open |wc -l`
155+[[ $NUMAMTS < 3 ]] && (echo "AMT or hostname not set correctly"; rm -f /etc/orange-box.conf;exit 2)
156+true
157+}
158+
159+
160+router_ip=172.27.${orangebox_number}.1
161+static_low=172.27.`expr ${orangebox_number} + 2`.1
162+static_high=172.27.`expr ${orangebox_number} + 2`.254
163+dhcp_low=172.27.`expr ${orangebox_number} + 1`.1
164+dhcp_high=172.27.`expr ${orangebox_number} + 1`.254
165+br0_broadcast=172.27.`expr ${orangebox_number} + 3`.255
166+
167+setup_maas_admin() {
168+ # Configure the MAAS admin user
169+ # Sadly, there's no way to test if the user has been created already,
170+ # so ignore errors for idempotence
171+ maas-region-admin createadmin --username admin --email maas-admin@example.com --password="admin" 2>/dev/null || true
172+ . /etc/maas/maas_cluster.conf
173+ APIKEY=$(maas-region-admin apikey --username admin | tail -n1)
174+ maas login admin $MAAS_URL $APIKEY
175+}
176+
177+setup_maas_networking() {
178+ count=0
179+ while ! maas admin node-group-interfaces list $CLUSTER_UUID >/dev/null 2>&1; do
180+ count=$((count+1))
181+ sleep 1
182+ if [ $count -gt $RETRY ]; then
183+ error "[maas admin node-group-interfaces list] failed [$RETRY] times"
184+ fi
185+ done
186+ internal_interface=$(route -n | grep "^172\.27\.${orangebox_number}\." | sed -e "s/.* //")
187+ # Support MAAS 1.5, and 1.6
188+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
189+ if dpkg --compare-versions $maas_ver lt 1.6; then
190+ maas admin node-group-interface update $CLUSTER_UUID $internal_interface ip_range_low=$static_low ip_range_high=$static_high management=2 broadcast_ip=$br0_broadcast router_ip=$router_ip
191+
192+ else
193+ sh -x /var/lib/dpkg/info/maas-dns.postinst configure
194+ run-one-until-success maas admin node-group-interface update $CLUSTER_UUID $internal_interface ip_range_low=$dhcp_low ip_range_high=$dhcp_high static_ip_range_low=$static_low static_ip_range_high=$static_high management=2 broadcast_ip=$br0_broadcast router_ip=$router_ip
195+
196+ fi
197+ # Setup nat
198+ # Ensure we have an external connection
199+ orange-box-test-uplink
200+ orange-box-setup-nat
201+ # Redirect to MAAS web interface
202+ cat >/var/www/html/index.html <<EOF
203+<meta http-equiv="refresh" content="0; url=/MAAS">
204+EOF
205+}
206+
207+setup_dns() {
208+ # Set MAAS upstream DNS
209+ maas admin maas set-config name=upstream_dns value=172.27.252.1
210+ sed -i -e "/^nameserver ${router_ip}$/d" /etc/resolvconf/resolv.conf.d/head
211+ echo "nameserver ${router_ip}" >> /etc/resolvconf/resolv.conf.d/head
212+ resolvconf -u
213+ sed -e 's/dnssec-validation auto;/dnssec-enable no;dnssec-validation no;/g' -i /etc/bind/named.conf.options
214+}
215+
216+setup_squid() {
217+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
218+ if dpkg --compare-versions $maas_ver lt 1.6; then
219+ # This is now a transparent proxy
220+ if [ -d "/etc/squid-deb-proxy" ]; then
221+ echo > /etc/squid-deb-proxy/squid-deb-proxy.conf
222+ fi
223+ cat /usr/lib/orange-box/inc/squid.conf > /etc/squid3/squid.conf
224+ # Enable squid3, disable squid-deb-proxy
225+ update-rc.d -f squid-deb-proxy remove || true
226+ invoke-rc.d squid-deb-proxy stop || true
227+ # Create directories, if necessary
228+ squid3 -z -N || true
229+ ensure_running squid3
230+ fi
231+ true
232+}
233+
234+setup_local_mirror() {
235+ # Set up the local mirror
236+ a2ensite archive
237+ a2ensite ubuntu-cloud
238+ a2dissite 000-default
239+ mkdir -p /srv/mirrors/archive.ubuntu.com
240+ echo '<meta http-equiv="refresh" content="0; url=MAAS/">' > /srv/mirrors/archive.ubuntu.com/index.html
241+ invoke-rc.d apache2 stop || true
242+ invoke-rc.d apache2 start
243+}
244+
245+setup_boot_resources() {
246+ # Importing boot resources
247+ # This might take a long time.
248+ # MAAS won't work very well until this is done, so we're going to block
249+ # until this completes.
250+ orange-box-test-uplink
251+ # Support MAAS 1.5, and newer
252+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
253+ if dpkg --compare-versions $maas_ver lt 1.6; then
254+ cat /usr/lib/orange-box/inc/bootresources_1.5.yaml > /etc/maas/bootresources.yaml
255+ run-this-one maas-import-pxe-files --config-file /etc/maas/bootresources.yaml
256+ else
257+ maas admin boot-resources import
258+ while [ $(maas admin boot-images read $CLUSTER_UUID | wc -l) -lt 10 ]; do
259+ # Waiting for images to download
260+ sleep 10
261+ done
262+ # add precise to the list but don't wait it is not necessary now.
263+ # usual failure is already there..
264+ maas admin boot-source-selections create 1 os="ubuntu" release="precise" arches="amd64" subarches="*" labels="*" || true
265+ maas admin boot-resources import
266+ fi
267+}
268+
269+setup_desktop() {
270+ sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.background picture-uri file:///usr/share/orange-box/orange-box-background.png
271+ sudo -u ubuntu dbus-launch gsettings set com.canonical.Unity.Launcher favorites "['firefox.desktop', 'byobu.desktop', 'remmina.desktop']"
272+ sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.session idle-delay 999999
273+ sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
274+ sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
275+ if [ -e /etc/lightdm/lightdm.conf ]; then
276+ sed -i -e "/autologin-user=/d" /etc/lightdm/users.conf
277+ echo "autologin-user=ubuntu" >> /etc/lightdm/users.conf
278+ fi
279+ echo "enabled=0" > /etc/default/apport
280+ invoke-rc.d apport stop || true
281+}
282+
283+setup_ssh_keys() {
284+ # Disable remote password authentication, since our username/password
285+ # combo is very well known
286+ if ! grep -qs "^PasswordAuthentication no" /etc/ssh/sshd_config 2>/dev/null; then
287+ echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
288+ invoke-rc.d ssh stop || true
289+ invoke-rc.d ssh start
290+ fi
291+ if [ ! -e /home/ubuntu/.ssh/id_rsa ]; then
292+ su -l ubuntu -c "ssh-keygen -N '' -f /home/ubuntu/.ssh/id_rsa"
293+ fi
294+ maas admin sshkeys new key="$(cat /home/ubuntu/.ssh/id_rsa.pub)" || true
295+ if ! grep -qs "^Host.*maas$" /home/ubuntu/.ssh/config; then
296+ cat <<EOF >>/home/ubuntu/.ssh/config
297+
298+Host *.maas
299+UserKnownHostsFile /dev/null
300+StrictHostKeyChecking no
301+CheckHostIP no
302+
303+EOF
304+ fi
305+ chmod 600 /home/ubuntu/.ssh/config
306+ chown -R ubuntu:ubuntu /home/ubuntu/.ssh/config
307+
308+}
309+
310+setup_juju() {
311+ mkdir -p /home/ubuntu/.juju
312+ cat >/home/ubuntu/.juju/environments.yaml <<EOF
313+default: maas
314+environments:
315+ maas:
316+ type: maas
317+ maas-server: 'http://${router_ip}/MAAS/'
318+ maas-oauth: '$APIKEY'
319+ default-series: trusty
320+ #enable-os-upgrade: false
321+ authorized-keys-path: /home/ubuntu/.ssh/id_rsa.pub
322+ admin-secret: 'admin'
323+ logging-config: '<root>=DEBUG'
324+ lxc-clone: true
325+EOF
326+ rm -rf /home/ubuntu/.juju-plugins
327+ git clone https://github.com/juju/plugins /home/ubuntu/.juju-plugins
328+ sudo chown -R ubuntu:ubuntu /home/ubuntu/
329+ echo "PATH=\$PATH:/home/ubuntu/.juju-plugins:/home/ubuntu/Examples/bin" >> /home/ubuntu/.bashrc
330+ #Required for local charm deployments to work.
331+ sed -i -e '/^export JUJU_REPOSITORY=/d' /home/ubuntu/.bashrc
332+}
333+
334+ensure_running() {
335+ job="$1"
336+ count=1
337+ while true; do
338+ if (service $job status | grep -qs "running"); then
339+ break
340+ fi
341+ invoke-rc.d $job start
342+ sleep 1
343+ count=$((count+1))
344+ if [ $count -gt $RETRY ]; then
345+ error "[$job] refused to start [$RETRY] times"
346+ fi
347+ done
348+}
349+
350+ensure_running_maas() {
351+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
352+ if dpkg --compare-versions $maas_ver lt 1.6; then
353+ ensure_running maas-region-celery
354+ ensure_running maas-cluster-celery
355+ ensure_running maas-txlongpoll
356+ ensure_running maas-pserv
357+ ensure_running maas-dhcp-server
358+ ensure_running squid3
359+ else
360+ ensure_running apache2
361+ ensure_running maas-clusterd
362+ ensure_running maas-dhcpd
363+ ensure_running maas-proxy
364+ fi
365+ invoke-rc.d tgt stop || true
366+ invoke-rc.d tgt start
367+ ensure_running tgt
368+}
369+
370+setup_all_nodes() {
371+ # Ensure that pxe and dhcp are running
372+ ensure_running_maas
373+ maas admin node-groups import-boot-images
374+ orange-box-add-physical-nodes
375+ orange-box-add-virtual-nodes
376+}
377+
378+apply_patches() {
379+ # This is a DISGUSTING HACK that needs to go away
380+ # as soon as MAAS ships these fixes
381+ cd /
382+ cat /usr/lib/orange-box/patches/acquire_languages_none.patch | patch -p0 -N || true
383+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
384+ if dpkg --compare-versions $maas_ver lt 1.6; then
385+ cat /usr/lib/orange-box/patches/arp_ip_order.patch | patch -p0 -N || true
386+ cat /usr/lib/orange-box/patches/try_amt_harder.patch | patch -p0 -N || true
387+ rm -f /usr/lib/python2.7/dist-packages/provisioningserver/utils/__init__.pyc
388+ invoke-rc.d maas-cluster-celery stop || true
389+ invoke-rc.d maas-cluster-celery start
390+ fi
391+ cd -
392+}
393+
394+setup_landscape() {
395+ # The master node will be managed by Landscape
396+ # TODO: this is currently hardcoded to our own landscape account
397+ if which landscape-config; then
398+ case "$(hostname)" in
399+ OrangeBox*|orangebox*)
400+ landscape-config -a canonical-orange -t "$(hostname)__$(dmidecode -s baseboard-serial-number)" -p ubuntu-aubergine --script-users=ALL --silent --include-manager-plugins=ScriptExecution || true
401+ ;;
402+ esac
403+ fi
404+}
405+
406+setup_examples() {
407+ mkdir -p /home/ubuntu
408+ if [ -d /home/ubuntu/Examples/.bzr ]; then
409+ bzr pull >/dev/null 2>&1 || true
410+ elif [ -d /home/ubuntu/Examples ]; then
411+ mv -f /home/ubuntu/Examples /home/ubuntu/.Examples
412+ bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
413+ else
414+ bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
415+ fi
416+ chown -R ubuntu:ubuntu /home/ubuntu
417+}
418+
419+case "$1" in
420+ configure)
421+ check_orangebox_number
422+ setup_desktop
423+ ###apply_patches
424+ setup_maas_admin
425+ setup_dns
426+ if [ -n "$2" ]; then
427+ echo
428+ echo "INFO: Skipping importing boot resources, since this is a package upgrade"
429+ echo "INFO: If you want to update boot resources, run:"
430+ echo "INFO: sudo maas-import-pxe-files"
431+ echo "INFO: sudo maas admin node-groups import-boot-images"
432+ echo
433+ else
434+ setup_boot_resources
435+ fi
436+ setup_maas_networking
437+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
438+ if dpkg --compare-versions $maas_ver lt 1.6; then
439+ setup_squid
440+ fi
441+ setup_local_mirror
442+ setup_ssh_keys
443+ setup_juju
444+ if [ -n "$2" ]; then
445+ echo
446+ echo "INFO: Skipping adding all nodes, since this is a package upgrade"
447+ echo "INFO: If you want to delete and add all nodes again, run:"
448+ echo "INFO: sudo orange-box-add-physical-nodes"
449+ echo "INFO: sudo orange-box-add-virtual-nodes"
450+ echo
451+ else
452+ # Only add all nodes and configure landscape on initial install, not upgrades
453+ setup_landscape
454+ setup_all_nodes
455+ fi
456+# setup_examples
457+ ;;
458+ abort-upgrade|abort-remove|abort-deconfigure)
459+ ;;
460+ *)
461+ echo "postinst called with unknown argument \`$1'" >&2
462+ exit 1
463+ ;;
464+esac
465+
466+#DEBHELPER#
467+
468+exit 0
469
470=== removed file 'debian/postinst'
471--- debian/postinst 2014-11-27 23:56:37 +0000
472+++ debian/postinst 1970-01-01 00:00:00 +0000
473@@ -1,310 +0,0 @@
474-#!/bin/sh
475-
476-set -e
477-set -x
478-
479-PKG="orange-box"
480-RETRY=120
481-
482-. /usr/lib/orange-box/inc/common
483-
484-setup_maas_admin() {
485- # Configure the MAAS admin user
486- # Sadly, there's no way to test if the user has been created already,
487- # so ignore errors for idempotence
488- maas-region-admin createadmin --username admin --email maas-admin@example.com --password="admin" 2>/dev/null || true
489- . /etc/maas/maas_cluster.conf
490- APIKEY=$(maas-region-admin apikey --username admin | tail -n1)
491- maas login admin $MAAS_URL $APIKEY
492-}
493-
494-setup_maas_networking() {
495- count=0
496- while ! maas admin node-group-interfaces list $CLUSTER_UUID >/dev/null 2>&1; do
497- count=$((count+1))
498- sleep 1
499- if [ $count -gt $RETRY ]; then
500- error "[maas admin node-group-interfaces list] failed [$RETRY] times"
501- fi
502- done
503- internal_interface=$(route -n | grep "^10\.14\." | sed -e "s/.* //")
504- # Support MAAS 1.5, and 1.6
505- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
506- if dpkg --compare-versions $maas_ver lt 1.6; then
507- maas admin node-group-interface update $CLUSTER_UUID $internal_interface ip_range_low=10.14.100.1 ip_range_high=10.14.199.254 management=2 broadcast_ip=10.14.255.255 router_ip=10.14.4.1
508- else
509- sh -x /var/lib/dpkg/info/maas-dns.postinst configure
510- run-one-until-success maas admin node-group-interface update $CLUSTER_UUID $internal_interface ip_range_low=10.14.50.1 ip_range_high=10.14.99.254 static_ip_range_low=10.14.100.1 static_ip_range_high=10.14.199.254 management=2 broadcast_ip=10.14.255.255 router_ip=10.14.4.1
511- fi
512- # Setup nat
513- # Ensure we have an external connection
514- orange-box-test-uplink
515- orange-box-setup-nat
516- # Redirect to MAAS web interface
517- cat >/var/www/html/index.html <<EOF
518-<meta http-equiv="refresh" content="0; url=/MAAS">
519-EOF
520-}
521-
522-setup_dns() {
523- # Set MAAS upstream DNS
524- external_interface=$(ip route ls | grep ^default | awk '{print $5}')
525- dns=$(nmcli d list iface $external_interface | grep -m 1 "^IP4.DNS" | awk '{ print $2 }')
526- maas admin maas set-config name=upstream_dns value=$dns
527- sed -i -e "/^nameserver 10.14.4.1$/d" /etc/resolvconf/resolv.conf.d/head
528- echo "nameserver 10.14.4.1" >> /etc/resolvconf/resolv.conf.d/head
529- resolvconf -u
530- sed -e 's/dnssec-validation auto;/dnssec-enable no;dnssec-validation no;/g' -i /etc/bind/named.conf.options
531-}
532-
533-setup_squid() {
534- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
535- if dpkg --compare-versions $maas_ver lt 1.6; then
536- # This is now a transparent proxy
537- if [ -d "/etc/squid-deb-proxy" ]; then
538- echo > /etc/squid-deb-proxy/squid-deb-proxy.conf
539- fi
540- cat /usr/lib/orange-box/inc/squid.conf > /etc/squid3/squid.conf
541- # Disable squid3, enable squid-deb-proxy
542- update-rc.d -f squid-deb-proxy remove || true
543- invoke-rc.d squid-deb-proxy stop || true
544- # Create directories, if necessary
545- squid3 -z -N || true
546- ensure_running squid3
547- fi
548- true
549-}
550-
551-setup_local_mirror() {
552- # Set up the local mirror
553- a2ensite archive
554- a2ensite ubuntu-cloud
555- a2dissite 000-default
556- mkdir -p /srv/mirrors/archive.ubuntu.com
557- echo '<meta http-equiv="refresh" content="0; url=MAAS/">' > /srv/mirrors/archive.ubuntu.com/index.html
558- invoke-rc.d apache2 stop || true
559- invoke-rc.d apache2 start
560- # Sync the charm store to /srv/charmstore
561- # Note: This is going to take a LONG time
562- orange-box-sync-charmstore &
563-}
564-
565-setup_boot_resources() {
566- # Importing boot resources
567- # This might take a long time.
568- # MAAS won't work very well until this is done, so we're going to block
569- # until this completes.
570- orange-box-test-uplink
571- # Support MAAS 1.5, and newer
572- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
573- if dpkg --compare-versions $maas_ver lt 1.6; then
574- cat /usr/lib/orange-box/inc/bootresources_1.5.yaml > /etc/maas/bootresources.yaml
575- run-this-one maas-import-pxe-files --config-file /etc/maas/bootresources.yaml
576- else
577- maas admin boot-resources import
578- while [ $(maas admin boot-images read $CLUSTER_UUID | wc -l) -lt 10 ]; do
579- # Waiting for images to download
580- sleep 10
581- done
582- fi
583-}
584-
585-setup_desktop() {
586- sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.background picture-uri file:///usr/share/orange-box/orange-box-background.png
587- sudo -u ubuntu dbus-launch gsettings set com.canonical.Unity.Launcher favorites "['firefox.desktop', 'byobu.desktop', 'remmina.desktop']"
588- sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.session idle-delay 999999
589- sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
590- sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
591- if [ -e /etc/lightdm/lightdm.conf ]; then
592- sed -i -e "/autologin-user=/d" /etc/lightdm/users.conf
593- echo "autologin-user=ubuntu" >> /etc/lightdm/users.conf
594- fi
595- echo "enabled=0" > /etc/default/apport
596- invoke-rc.d apport stop || true
597-}
598-
599-setup_ssh_keys() {
600- # Disable remote password authentication, since our username/password
601- # combo is very well known
602- if ! grep -qs "^PasswordAuthentication no" /etc/ssh/sshd_config 2>/dev/null; then
603- echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
604- invoke-rc.d ssh stop || true
605- invoke-rc.d ssh start
606- fi
607- if [ ! -e /home/ubuntu/.ssh/id_rsa ]; then
608- su -l ubuntu -c "ssh-keygen -N '' -f /home/ubuntu/.ssh/id_rsa"
609- fi
610- maas admin sshkeys new key="$(cat /home/ubuntu/.ssh/id_rsa.pub)" || true
611- if ! grep -qs "^Host.*maas$" /home/ubuntu/.ssh/config; then
612- cat <<EOF >>/home/ubuntu/.ssh/config
613-
614-Host *.maas
615-UserKnownHostsFile /dev/null
616-StrictHostKeyChecking no
617-CheckHostIP no
618-
619-EOF
620- fi
621- chmod 600 /home/ubuntu/.ssh/config
622- chown -R ubuntu:ubuntu /home/ubuntu/.ssh/config
623-}
624-
625-setup_juju() {
626- mkdir -p /home/ubuntu/.juju
627- cat >/home/ubuntu/.juju/environments.yaml <<EOF
628-default: maas
629-environments:
630- maas:
631- type: maas
632- maas-server: 'http://10.14.4.1/MAAS/'
633- maas-oauth: '$APIKEY'
634- default-series: trusty
635- #enable-os-upgrade: false
636- authorized-keys-path: /home/ubuntu/.ssh/id_rsa.pub
637- admin-secret: 'admin'
638- logging-config: '<root>=DEBUG'
639- lxc-clone: true
640-EOF
641- rm -rf /home/ubuntu/.juju-plugins
642- git clone https://github.com/juju/plugins /home/ubuntu/.juju-plugins
643- sudo chown -R ubuntu:ubuntu /home/ubuntu/
644- echo "PATH=\$PATH:/home/ubuntu/.juju-plugins:/home/ubuntu/Examples/bin" >> /home/ubuntu/.bashrc
645- #Required for local charm deployments to work.
646- sed -i -e '/^export JUJU_REPOSITORY=/d' /home/ubuntu/.bashrc
647- echo "export JUJU_REPOSITORY=/srv/charmstore" >> /home/ubuntu/.bashrc
648-}
649-
650-ensure_running() {
651- job="$1"
652- count=1
653- while true; do
654- if (service $job status | grep -qs "running"); then
655- break
656- fi
657- invoke-rc.d $job start
658- sleep 1
659- count=$((count+1))
660- if [ $count -gt $RETRY ]; then
661- error "[$job] refused to start [$RETRY] times"
662- fi
663- done
664-}
665-
666-ensure_running_maas() {
667- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
668- if dpkg --compare-versions $maas_ver lt 1.6; then
669- ensure_running maas-region-celery
670- ensure_running maas-cluster-celery
671- ensure_running maas-txlongpoll
672- ensure_running maas-pserv
673- ensure_running maas-dhcp-server
674- ensure_running squid3
675- else
676- ensure_running apache2
677- ensure_running maas-clusterd
678- ensure_running maas-dhcpd
679- ensure_running maas-proxy
680- fi
681- invoke-rc.d tgt stop || true
682- invoke-rc.d tgt start
683- ensure_running tgt
684-}
685-
686-setup_all_nodes() {
687- # Ensure that pxe and dhcp are running
688- ensure_running_maas
689- maas admin node-groups import-boot-images
690- orange-box-add-physical-nodes
691- orange-box-add-virtual-nodes
692-}
693-
694-apply_patches() {
695- # This is a DISGUSTING HACK that needs to go away
696- # as soon as MAAS ships these fixes
697- cd /
698- cat /usr/lib/orange-box/patches/acquire_languages_none.patch | patch -p0 -N || true
699- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
700- if dpkg --compare-versions $maas_ver lt 1.6; then
701- cat /usr/lib/orange-box/patches/arp_ip_order.patch | patch -p0 -N || true
702- cat /usr/lib/orange-box/patches/try_amt_harder.patch | patch -p0 -N || true
703- rm -f /usr/lib/python2.7/dist-packages/provisioningserver/utils/__init__.pyc
704- invoke-rc.d maas-cluster-celery stop || true
705- invoke-rc.d maas-cluster-celery start
706- fi
707- cd -
708-}
709-
710-setup_landscape() {
711- # The master node will be managed by Landscape
712- # TODO: this is currently hardcoded to our own landscape account
713- if which landscape-config; then
714- case "$(hostname)" in
715- OrangeBox*|orangebox*)
716- landscape-config -a canonical-orange -t "$(hostname)__$(dmidecode -s baseboard-serial-number)" -p ubuntu-aubergine --script-users=ALL --silent --include-manager-plugins=ScriptExecution || true
717- ;;
718- esac
719- fi
720-}
721-
722-setup_examples() {
723- mkdir -p /home/ubuntu
724- if [ -d /home/ubuntu/Examples/.bzr ]; then
725- bzr pull >/dev/null 2>&1 || true
726- elif [ -d /home/ubuntu/Examples ]; then
727- mv -f /home/ubuntu/Examples /home/ubuntu/.Examples
728- bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
729- else
730- bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
731- fi
732- chown -R ubuntu:ubuntu /home/ubuntu
733-}
734-
735-case "$1" in
736- configure)
737- setup_desktop
738- apply_patches
739- setup_maas_admin
740- setup_dns
741- if [ -n "$2" ]; then
742- echo
743- echo "INFO: Skipping importing boot resources, since this is a package upgrade"
744- echo "INFO: If you want to update boot resources, run:"
745- echo "INFO: sudo maas-import-pxe-files"
746- echo "INFO: sudo maas admin node-groups import-boot-images"
747- echo
748- else
749- setup_boot_resources
750- fi
751- setup_maas_networking
752- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
753- if dpkg --compare-versions $maas_ver lt 1.6; then
754- setup_squid
755- fi
756- setup_local_mirror
757- setup_ssh_keys
758- setup_juju
759- if [ -n "$2" ]; then
760- echo
761- echo "INFO: Skipping adding all nodes, since this is a package upgrade"
762- echo "INFO: If you want to delete and add all nodes again, run:"
763- echo "INFO: sudo orange-box-add-physical-nodes"
764- echo "INFO: sudo orange-box-add-virtual-nodes"
765- echo
766- else
767- # Only add all nodes and configure landscape on initial install, not upgrades
768- setup_landscape
769- setup_all_nodes
770- fi
771- setup_examples
772- ;;
773- abort-upgrade|abort-remove|abort-deconfigure)
774- ;;
775- *)
776- echo "postinst called with unknown argument \`$1'" >&2
777- exit 1
778- ;;
779-esac
780-
781-#DEBHELPER#
782-
783-exit 0
784
785=== added file 'debian/postrm'
786--- debian/postrm 1970-01-01 00:00:00 +0000
787+++ debian/postrm 2015-07-21 17:58:26 +0000
788@@ -0,0 +1,23 @@
789+#!/bin/sh
790+
791+set -e
792+
793+webserver="apache2"
794+
795+case "$1" in
796+ remove)
797+ for i in archive ubuntu-cloud; do
798+ if [ -e "/etc/apache2/sites-enabled/${i}.conf" ]; then
799+ a2dissite $i
800+ fi
801+ done
802+ invoke-rc.d $webserver reload
803+ rm -f /var/log/orange-box-mirror.log
804+ rm -rf /etc/maas
805+ rm -rf /var/lib/orange-box
806+ ;;
807+esac
808+
809+#DEBHELPER#
810+
811+exit 0
812
813=== removed file 'debian/postrm'
814--- debian/postrm 2014-07-17 04:12:46 +0000
815+++ debian/postrm 1970-01-01 00:00:00 +0000
816@@ -1,23 +0,0 @@
817-#!/bin/sh
818-
819-set -e
820-
821-webserver="apache2"
822-
823-case "$1" in
824- remove)
825- for i in archive ubuntu-cloud; do
826- if [ -e "/etc/apache2/sites-enabled/${i}.conf" ]; then
827- a2dissite $i
828- fi
829- done
830- invoke-rc.d $webserver reload
831- rm -f /var/log/orange-box-mirror.log
832- rm -rf /etc/maas
833- rm -rf /var/lib/orange-box
834- ;;
835-esac
836-
837-#DEBHELPER#
838-
839-exit 0
840
841=== added file 'debian/preinst'
842--- debian/preinst 1970-01-01 00:00:00 +0000
843+++ debian/preinst 2015-07-21 17:58:26 +0000
844@@ -0,0 +1,166 @@
845+#!/bin/sh
846+set -e
847+set -x
848+
849+get_orangebox_number() {
850+## assume hostname as been set correctly .. will be checked in postinst
851+OBNum=`hostname | cut -c 10- -`
852+echo $OBNum
853+echo "orangebox_number=$OBNum" > /etc/orange-box.conf
854+}
855+
856+### According to OB networking re-design
857+orangebox_number=`get_orangebox_number`
858+default_maas_ip=172.27.${orangebox_number}.1
859+gateway_ip=172.27.252.1
860+external_ip=172.27.252.${orangebox_number}
861+internal_ip=172.27.${orangebox_number}.1
862+br0_broadcast=172.27.`expr ${orangebox_number} + 3`.255
863+
864+#unnecessary comment
865+
866+preflight_checks() {
867+ if [ "$(id -u ubuntu)" != "1000" ]; then
868+ echo "ERROR: Read the docs; a proper OrangeBox setup requires the default user to be [ubuntu]" 1>&2
869+ exit 1
870+ fi
871+ #ensure em1 is the correct name
872+ biosdevname -i eth1 || (echo "biosdevname should have been run already assume it does"; true)
873+ # TODO: Check that the AMTs are on static IPs
874+ # TODO: Check dual hard drives, which one is which
875+ # TODO: Ensure we have two interfaces, one internal, one external
876+}
877+
878+setup_debconf() {
879+ echo "debconf maas/default-maas-url string $default_maas_ip" | debconf-set-selections -
880+ echo "debconf maas-cluster-controller/maas-url string http://${default_maas_ip}/MAAS" | debconf-set-selections -
881+ echo "debconf maas/installation-note boolean true" | debconf-set-selections -
882+ echo "debconf iptables-persistent/autosave_done boolean true" | debconf-set-selections -
883+ echo "debconf iptables-persistent/autosave_v4 boolean true" | debconf-set-selections -
884+ echo "debconf iptables-persistent/autosave_v6 boolean true" | debconf-set-selections -
885+}
886+
887+setup_networking() {
888+ modprobe 8021q || true
889+ sed -i -e "/8021q/d" /etc/modules || true
890+ echo "8021q" >> /etc/modules
891+ # Set up the two network interfaces
892+ external_interface=$(ip route ls | grep ^default | awk '{print $5}')
893+ # TODO: ip addr ls
894+ for interface in $(ifconfig -a -s | grep -v ^Iface | awk '{print $1}'); do
895+ case "$interface" in
896+ lo|br*|wlan*|vnet*)
897+ continue
898+ ;;
899+ $external_interface)
900+ continue
901+ ;;
902+ *)
903+ internal_interface="$interface"
904+ break
905+ ;;
906+ esac
907+ done
908+ # Set a sane default as em1 because the biosdevname should have been installed and run
909+ [ -z "$internal_interface" ] && internal_interface=em1
910+ # TODO: use ip
911+ default_mac=$(ifconfig "$internal_interface" | grep "^$internal_interface" | sed -e "s/.*HWaddr //")
912+ # Tell NetworkManager to piss off
913+ sed -i -e "/^unmanaged-devices=mac:$default_mac$/d" /etc/NetworkManager/NetworkManager.conf
914+ cat >>/etc/NetworkManager/NetworkManager.conf <<EOF
915+[keyfile]
916+unmanaged-devices=mac:$default_mac
917+EOF
918+ invoke-rc.d network-manager stop || true
919+ invoke-rc.d network-manager start
920+ cat >/etc/network/interfaces <<EOF
921+auto lo
922+iface lo inet loopback
923+
924+auto $external_interface
925+iface $external_interface inet static
926+ address ${external_ip}
927+ netmask 255.255.252.0
928+ broadcast 172.27.255.255
929+ gateway ${gateway_ip}
930+ dns-nameservers ${gateway_ip}
931+
932+auto $internal_interface
933+iface $internal_interface inet manual
934+
935+
936+auto br0
937+iface br0 inet static
938+ address ${internal_ip}
939+ netmask 255.255.252.0
940+ broadcast $br0_broadcast
941+ bridge_ports $internal_interface
942+ bridge_stp off
943+ bridge_fd 0
944+ bridge_maxwait 0
945+
946+# VLAN 2, Uplink network
947+iface ${internal_interface}.2 inet dhcp
948+vlan-raw-device $internal_interface
949+
950+# Network management alias
951+iface br0:1 inet static
952+address 10.90.90.91
953+netmask 255.255.255.0
954+broadcast 10.90.90.255
955+
956+EOF
957+ ifdown --force $internal_interface || true
958+ ifdown --force br0 || true
959+ ifup $internal_interface
960+ ifup br0
961+ ### Same for $external_interface
962+ ifdown --force $external_interface || true
963+ ifup $external_interface
964+
965+ # Wait a moment for the network to normalize
966+ echo "INFO: Ensure networking has settled"
967+ run-one-until-success ping -c 10 maas.ubuntu.com
968+}
969+
970+setup_external_drive() {
971+ # External drive must be:
972+ # a) partitioned into 1 big partition
973+ # b) ext4 formatted
974+ # Find root disk
975+ root_disk=$(mount | grep " on / " | awk '{print $1}' | sed -e "s/[0-9]\+$//")
976+ # Find biggest non-root disk
977+ ext_disk=$(fdisk -l | grep "^Disk /" | grep -v $root_disk | sort -k4 -n -r | awk '{print $2}' | awk -F: '{print $1}')
978+ partition="${ext_disk}1"
979+ if [ -b "$ext_disk" ]; then
980+ if [ ! -b "$partition" ]; then
981+ # Create the partition, if it doesn't exist already
982+ echo "n
983+p
984+1
985+
986+
987+w
988+"|fdisk "$ext_disk"
989+ mkfs.ext4 "$partition"
990+ fi
991+ sed -i -e "/ \/srv/d" /etc/fstab
992+ # Add the fstab entry
993+ uuid=$(blkid -s UUID -o value "$partition")
994+ echo "UUID=$uuid /srv ext4 defaults 1 1" >> /etc/fstab
995+ fi
996+ umount $partition || true
997+ mount -a
998+ chown root:root /srv
999+ chmod 755 /srv
1000+}
1001+
1002+
1003+preflight_checks
1004+setup_external_drive
1005+setup_debconf
1006+setup_networking
1007+
1008+#DEBHELPER#
1009+
1010+exit 0
1011
1012=== removed file 'debian/preinst'
1013--- debian/preinst 2014-08-25 14:32:16 +0000
1014+++ debian/preinst 1970-01-01 00:00:00 +0000
1015@@ -1,136 +0,0 @@
1016-#!/bin/sh
1017-set -e
1018-set -x
1019-
1020-#unnecessary comment
1021-
1022-preflight_checks() {
1023- if [ "$(id -u ubuntu)" != "1000" ]; then
1024- echo "ERROR: Read the docs; a proper OrangeBox setup requires the default user to be [ubuntu]" 1>&2
1025- exit 1
1026- fi
1027- # TODO: Check that the AMTs are on static IPs
1028- # TODO: Check dual hard drives, which one is which
1029- # TODO: Ensure we have two interfaces, one internal, one external
1030-}
1031-
1032-setup_debconf() {
1033- echo "debconf maas/default-maas-url string 10.14.4.1" | debconf-set-selections -
1034- echo "debconf maas-cluster-controller/maas-url string http://10.14.4.1/MAAS" | debconf-set-selections -
1035- echo "debconf maas/installation-note boolean true" | debconf-set-selections -
1036- echo "debconf iptables-persistent/autosave_done boolean true" | debconf-set-selections -
1037- echo "debconf iptables-persistent/autosave_v4 boolean true" | debconf-set-selections -
1038- echo "debconf iptables-persistent/autosave_v6 boolean true" | debconf-set-selections -
1039-}
1040-
1041-setup_networking() {
1042- modprobe 8021q || true
1043- sed -i -e "/8021q/d" /etc/modules || true
1044- echo "8021q" >> /etc/modules
1045- # Set up the two network interfaces
1046- external_interface=$(ip route ls | grep ^default | awk '{print $5}')
1047- # TODO: ip addr ls
1048- for interface in $(ifconfig -a -s | grep -v ^Iface | awk '{print $1}'); do
1049- case "$interface" in
1050- lo|br*|wlan*)
1051- continue
1052- ;;
1053- $external_interface)
1054- continue
1055- ;;
1056- *)
1057- internal_interface="$interface"
1058- break
1059- ;;
1060- esac
1061- done
1062- # Set a sane default
1063- [ -z "$internal_interface" ] && internal_interface=eth0
1064- # TODO: use ip
1065- default_mac=$(ifconfig "$internal_interface" | grep "^$internal_interface" | sed -e "s/.*HWaddr //")
1066- # Tell NetworkManager to piss off
1067- sed -i -e "/^unmanaged-devices=mac:$default_mac$/d" /etc/NetworkManager/NetworkManager.conf
1068- cat >>/etc/NetworkManager/NetworkManager.conf <<EOF
1069-[keyfile]
1070-unmanaged-devices=mac:$default_mac
1071-EOF
1072- invoke-rc.d network-manager stop || true
1073- invoke-rc.d network-manager start
1074- cat >/etc/network/interfaces <<EOF
1075-auto lo
1076-iface lo inet loopback
1077-
1078-auto $internal_interface
1079-iface $internal_interface inet manual
1080-
1081-auto br0
1082-iface br0 inet static
1083- address 10.14.4.1
1084- netmask 255.255.0.0
1085- broadcast 10.14.255.255
1086- bridge_ports $internal_interface
1087- bridge_stp off
1088- bridge_fd 0
1089- bridge_maxwait 0
1090-
1091-# VLAN 2, Uplink network
1092-iface eth0.2 inet dhcp
1093-vlan-raw-device eth0
1094-
1095-# Network management alias
1096-iface br0:1 inet static
1097-address 10.90.90.91
1098-netmask 255.255.255.0
1099-broadcast 10.90.90.255
1100-
1101-EOF
1102- ifdown --force $internal_interface || true
1103- ifdown --force br0 || true
1104- ifup $internal_interface
1105- ifup br0
1106- # Wait a moment for the network to normalize
1107- echo "INFO: Ensure networking has settled"
1108- run-one-until-success ping -c 10 maas.ubuntu.com
1109-}
1110-
1111-setup_external_drive() {
1112- # External drive must be:
1113- # a) partitioned into 1 big partition
1114- # b) ext4 formatted
1115- # Find root disk
1116- root_disk=$(mount | grep " on / " | awk '{print $1}' | sed -e "s/[0-9]\+$//")
1117- # Find biggest non-root disk
1118- ext_disk=$(fdisk -l | grep "^Disk /" | grep -v $root_disk | sort -k4 -n -r | awk '{print $2}' | awk -F: '{print $1}')
1119- partition="${ext_disk}1"
1120- if [ -b "$ext_disk" ]; then
1121- if [ ! -b "$partition" ]; then
1122- # Create the partition, if it doesn't exist already
1123- echo "n
1124-p
1125-1
1126-
1127-
1128-w
1129-"|fdisk "$ext_disk"
1130- mkfs.ext4 "$partition"
1131- fi
1132- sed -i -e "/ \/srv/d" /etc/fstab
1133- # Add the fstab entry
1134- uuid=$(blkid -s UUID -o value "$partition")
1135- echo "UUID=$uuid /srv ext4 defaults 1 1" >> /etc/fstab
1136- fi
1137- umount $partition || true
1138- mount -a
1139- chown root:root /srv
1140- chmod 755 /srv
1141-}
1142-
1143-
1144-preflight_checks
1145-setup_external_drive
1146-setup_debconf
1147-setup_networking
1148-
1149-#DEBHELPER#
1150-
1151-exit 0
1152
1153=== modified file 'debian/source/format'
1154--- debian/source/format 2014-04-04 19:40:10 +0000
1155+++ debian/source/format 2015-07-21 17:58:26 +0000
1156@@ -1,1 +1,1 @@
1157-3.0 (quilt)
1158+3.0 (native)
1159
1160=== modified file 'etc/apt/orange-box-mirror.list'
1161--- etc/apt/orange-box-mirror.list 2015-01-21 22:04:42 +0000
1162+++ etc/apt/orange-box-mirror.list 2015-07-21 17:58:26 +0000
1163@@ -8,7 +8,7 @@
1164 set var_path $base_path/var
1165 set cleanscript /bin/true
1166 set defaultarch amd64
1167-set postmirror_script /bin/true
1168+# set postmirror_script $var_path/postmirror.sh
1169 # set run_postmirror 0
1170 set nthreads 20
1171 set _tilde 0
1172
1173=== modified file 'usr/bin/orange-box-add-node'
1174--- usr/bin/orange-box-add-node 2014-10-27 20:54:45 +0000
1175+++ usr/bin/orange-box-add-node 2015-07-21 17:58:26 +0000
1176@@ -23,6 +23,9 @@
1177 set -e
1178 set -x
1179
1180+## According to OB network re-design
1181+. /etc/orange-box.conf
1182+
1183 ip_to_mac() {
1184 local ip="$1"
1185 arp -n | sort | grep -m1 "^$ip\s" | awk '{print $3}'
1186@@ -31,7 +34,7 @@
1187 node_name() {
1188 local num="${1##*.}"
1189 num=$((num-10))
1190- echo "node${num}"
1191+ echo "node${num}ob${orangebox_number}"
1192 }
1193
1194 hostname_to_system_id() {
1195@@ -60,20 +63,20 @@
1196 maas admin zone read zone2 || maas admin zones create name=zone2 description="Physical machines on right side of Orange Box"
1197
1198 #Create maas-br0 network if it does not already exist
1199-maas admin network read maas-br0 || maas admin networks create name=maas-br0 ip=10.14.0.0 netmask=255.255.0.0 default_gateway=10.14.4.1 dns_servers=10.14.4.1 description="Auto created when running orange-box-add-node"
1200+maas admin network read maas-br0 || maas admin networks create name=maas-br0 ip=172.27.${orangebox_number}.0 netmask=255.255.252.0 default_gateway=172.27.${orangebox_number}.1 dns_servers=172.27.${orangebox_number}.1 description="Auto created when running orange-box-add-node"
1201
1202 # Loop over the list of ip addresses listening on 16992
1203 for ip in $@; do
1204 mac=$(ip_to_mac $ip)
1205 hostname=$(node_name $ip)
1206- node=${hostname#node}
1207+ node=`echo ${hostname}| sed "s/node\(.*\)ob${orangebox_number}/\1/"`
1208 if [ $node -lt 5 ]; then
1209 zone="zone1"
1210 else
1211 zone="zone2"
1212 fi
1213 info "$ip --> $hostname --> $mac"
1214- if [ -z "$ip" ] || [ "$ip" = "10.14.4.1" ]; then
1215+ if [ -z "$ip" ] || [ "$ip" = "172.27.${orangebox_number}.1" ]; then
1216 continue
1217 fi
1218 # Remove it, if it's already here
1219
1220=== modified file 'usr/bin/orange-box-add-physical-nodes'
1221--- usr/bin/orange-box-add-physical-nodes 2014-07-11 18:27:46 +0000
1222+++ usr/bin/orange-box-add-physical-nodes 2015-07-21 17:58:26 +0000
1223@@ -25,11 +25,16 @@
1224
1225 oauth_login
1226
1227+## According to OB network re-design
1228+. /etc/orange-box.conf
1229+
1230+
1231+
1232 # Search for nodes listening on AMT's 16992
1233 info "Searching for all nodes on the local network listening on 16992; this will take 60 seconds...."
1234-ips=$(time for i in $(seq 1 10); do nmap -p 16992 -oG - 10.14.4.1/24 | grep 16992/open | awk '{print $2}' ; done | sort -u -r)
1235+ips=$(time for i in $(seq 1 10); do nmap -p 16992 -oG - 172.27.${orangebox_number}.1/22 | grep 16992/open | awk '{print $2}' ; done | sort -u -r)
1236 if [ -z "$ips" ]; then
1237- error "nmap did not find any nodes listening on [16992] on the [10.14.4.1/24] network"
1238+ error "nmap did not find any nodes listening on [16992] on the [172.27.${orangebox_number}.1/22] network"
1239 fi
1240 info "Found: [$ips]"
1241
1242
1243=== modified file 'usr/bin/orange-box-add-virtual-nodes'
1244--- usr/bin/orange-box-add-virtual-nodes 2015-02-07 16:07:08 +0000
1245+++ usr/bin/orange-box-add-virtual-nodes 2015-07-21 17:58:26 +0000
1246@@ -18,6 +18,13 @@
1247 # You should have received a copy of the GNU General Public License
1248 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1249
1250+##
1251+##
1252+. /etc/orange-box.conf
1253+
1254+external_ip="172.27.252.${orangebox_number}"
1255+internal_ip="172.27.${orangebox_number}.1"
1256+internal_network="172.27.${orangebox_number}.0"
1257
1258 if [ "$(id -u)" != "0" ]; then
1259 echo "Must be run with sudo or by root"
1260@@ -29,13 +36,27 @@
1261
1262 virsh net-info default && virsh net-destroy default && virsh net-undefine default
1263
1264-[ -d ~maas ] || install -d /var/lib/maas --owner maas --group maas
1265+[ -d /var/lib/maas ] || install -d /var/lib/maas --owner maas --group maas
1266 chsh maas -s /bin/bash
1267-[ -d ~maas/.ssh ] || echo -e "\n\n\n" | sudo -u maas ssh-keygen -N "" -t rsa -f ~maas/.ssh/id_rsa
1268-grep 'maas@' /home/ubuntu/.ssh/authorized_keys || cat ~maas/.ssh/id_rsa.pub | tee -a /home/ubuntu/.ssh/authorized_keys
1269-printf "%s,%s %s %s\n" "node0.maas" "10.14.4.1" $(awk '{print $1 " " $2}' /etc/ssh/ssh_host_ecdsa_key.pub) | tee -a ~maas/.ssh/known_hosts
1270+[ -d /var/lib/maas/.ssh ] || mkdir /var/lib/maas/.ssh && chown maas:maas /var/lib/maas/.ssh
1271+[ -f /var/lib/maas/.ssh/id_rsa ] || echo -e "\n\n\n" | sudo -u maas ssh-keygen -N "" -t rsa -f /var/lib/maas/.ssh/id_rsa
1272+[ -f /var/lib/maas/.ssh/known_hosts ] || sudo -u maas ssh-keyscan 172.27.${orangebox_number}.1 |sudo -u maas tee -a /var/lib/maas/.ssh/known_hosts > /dev/null
1273+#Always add host keys .. not an issue if files grows
1274+sudo -u maas ssh-keyscan 172.27.${orangebox_number}.1 |sudo -u maas tee -a /var/lib/maas/.ssh/known_hosts > /dev/null
1275+# if very first install ubuntu user might not have authorized keys set.
1276+if [ ! -f /home/ubuntu/.ssh/authorized_keys ]; then
1277+ mkdir -p /home/ubuntu/.ssh/
1278+ cat /var/lib/maas/.ssh/id_rsa.pub | tee -a /home/ubuntu/.ssh/authorized_keys
1279+ chown -R ubuntu /home/ubuntu/.ssh/
1280+ chmod 700 /home/ubuntu/.ssh/
1281+fi
1282+sudo -u maas virsh -c qemu+ssh://ubuntu@172.27.${orangebox_number}.1/system list > /dev/null || sed -i '/ maas@/d' /home/ubuntu/.ssh/authorized_keys
1283+#If there is no key /new install or just removed add it"
1284+grep 'maas@' /home/ubuntu/.ssh/authorized_keys || cat /var/lib/maas/.ssh/id_rsa.pub | tee -a /home/ubuntu/.ssh/authorized_keys
1285+printf "%s,%s %s %s\n" "node0.maas" "$internal_ip" $(awk '{print $1 " " $2}' /etc/ssh/ssh_host_ecdsa_key.pub) | tee -a /var/lib/maas/.ssh/known_hosts
1286 chown -R ubuntu:ubuntu /home/ubuntu
1287
1288+
1289 maas admin tags new name=virtual || true
1290 maas admin tags new name=bootstrap || true
1291 maas admin tags new name=neutron || true
1292@@ -53,25 +74,23 @@
1293 maas admin zone read zone0 || maas admin zones create name=zone0 description="Virtual machines on node0"
1294
1295 #Create maas-br0 network if it does not already exist
1296-maas admin network read maas-br0 || maas admin networks create name=maas-br0 ip=10.14.0.0 netmask=255.255.0.0 default_gateway=10.14.4.1 dns_servers=10.14.4.1 description="Auto created when running orange-box-add-virtual-nodes"
1297+### For APAC Roadshow
1298+maas admin network read maas-br0 || maas admin networks create name=maas-br0 ip=${internal_network} netmask=255.255.252.0 default_gateway=${internal_ip} dns_servers=${internal_ip} description="Auto created when running orange-box-add-virtual-nodes"
1299+
1300
1301 for i in $(seq 0 2 | sort -r); do
1302- hostname="node0vm${i}.maas"
1303+ hostname="node0vm${i}ob${orangebox_number}.maas"
1304 virsh destroy $hostname || true
1305 virsh undefine $hostname || true
1306 echo "INFO: Installing virtual machine"
1307- virt-install --debug --name $hostname --ram 4096 --disk=path=/var/lib/orange-box/${hostname}-1.img,size=20 --disk=path=/var/lib/orange-box/${hostname}-2.img,size=2 --vcpus=2 --os-type=linux --pxe --network=bridge=br0,model=virtio --network=bridge=br0,model=rtl8139 --boot network --video=cirrus --graphics vnc|| true
1308+ virt-install --debug --name $hostname --ram 4096 --disk=path=/var/lib/orange-box/${hostname}-1.img,size=20 --disk=path=/var/lib/orange-box/${hostname}-2.img,size=2 --vcpus=2 --os-type=linux --pxe --network=bridge=br0 --network=bridge=br0 --boot network --video=cirrus --graphics vnc|| true
1309 virsh console $hostname || true
1310- #Workaround for bug: https://bugs.launchpad.net/maas/+bug/1367482
1311- virsh dumpxml $hostname > /tmp/${hostname}.xml
1312- sed -i -e "s#<model type='rtl8139'/>#<model type='rtl8139'/> <rom file=''/>#" /tmp/${hostname}.xml
1313- virsh define /tmp/${hostname}.xml
1314 virsh autostart $hostname
1315 mac=$(virsh dumpxml $hostname | python -c 'import sys, lxml.etree; print list(lxml.etree.parse(sys.stdin).iter("mac"))[0].get("address")')
1316 mac2=$(virsh dumpxml $hostname | python -c 'import sys, lxml.etree; print list(lxml.etree.parse(sys.stdin).iter("mac"))[0].get("address")')
1317 system_id=$(maas admin nodes list mac_address=$mac | grep system_id | cut -d'"' -f4)
1318 if [ -n "$system_id" ]; then
1319- maas admin node update $system_id hostname=$hostname power_type=virsh power_parameters_power_address=qemu+ssh://ubuntu@10.14.4.1/system power_parameters_power_id=$hostname
1320+ maas admin node update $system_id hostname=$hostname power_type=virsh power_parameters_power_address=qemu+ssh://ubuntu@${internal_ip}/system power_parameters_power_id=$hostname
1321 maas admin tag update-nodes "virtual" add=$system_id
1322 case $i in
1323 0)
1324
1325=== modified file 'usr/bin/orange-box-amt-monitor'
1326--- usr/bin/orange-box-amt-monitor 2014-04-16 22:26:52 +0000
1327+++ usr/bin/orange-box-amt-monitor 2015-07-21 17:58:26 +0000
1328@@ -1,3 +1,5 @@
1329 #!/bin/sh
1330
1331-watch -n 10 "sudo nmap -p 16992 -oG - 10.14.4.1/24 | grep 16992/open | sort"
1332+. /etc/orange-box.conf
1333+watch -n 10 "sudo nmap -p 16992 -oG - 172.27.${orangebox_number}.0/22 | grep 16992/open | sort"
1334+
1335
1336=== removed file 'usr/bin/orange-box-apm-power-fix'
1337--- usr/bin/orange-box-apm-power-fix 2014-10-31 09:19:40 +0000
1338+++ usr/bin/orange-box-apm-power-fix 1970-01-01 00:00:00 +0000
1339@@ -1,38 +0,0 @@
1340-#!/bin/sh
1341-#
1342-# orange-box-apm-power-fix - fix for issue with orange-box-apm-power
1343-# Copyright (C) 2014 Canonical Ltd.
1344-#
1345-# Authors: Darryl Weaver <darryl.weaver@canonical.com>
1346-#
1347-# This program is free software: you can redistribute it and/or modify
1348-# it under the terms of the GNU General Public License as published by
1349-# the Free Software Foundation, version 3 of the License.
1350-#
1351-# This program is distributed in the hope that it will be useful,
1352-# but WITHOUT ANY WARRANTY; without even the implied warranty of
1353-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1354-# GNU General Public License for more details.
1355-#
1356-# You should have received a copy of the GNU General Public License
1357-# along with this program. If not, see <http://www.gnu.org/licenses/>.
1358-
1359-set -x
1360-
1361-if [ ! -f /var/lib/maas/boot-resources/current/syslinux/poweroff-APM.com ]
1362-then
1363-cd /srv/data
1364-wget https://launchpadlibrarian.net/187530745/acpioff.c32
1365-cd /var/lib/maas/boot-resources/current/syslinux
1366-sudo mv poweroff.com poweroff-APM.com
1367-sudo mv /srv/data/acpioff.c32 poweroff.c32
1368-fi
1369-
1370-#fixing the AMT template
1371-cd /srv/data
1372-wget https://launchpadlibrarian.net/187911231/not-permitted.patch
1373-cd /etc/maas/templates/power
1374-patch < /srv/data/not-permitted.patch
1375-
1376-exit
1377-
1378
1379=== modified file 'usr/bin/orange-box-bootstrap-juju'
1380--- usr/bin/orange-box-bootstrap-juju 2015-01-07 23:15:31 +0000
1381+++ usr/bin/orange-box-bootstrap-juju 2015-07-21 17:58:26 +0000
1382@@ -24,8 +24,12 @@
1383 timeout 1m run-one-until-success nc -w 10 -zvv $@ 2>&1
1384 }
1385
1386+## According to OB network re-disign
1387+. /etc/orange-box.conf
1388+
1389 juju status && echo "Existing deployment found, exiting." && exit 0
1390-juju bootstrap --to node0vm0.maas --show-log --upload-tools
1391+###juju bootstrap --to node0ob${orangebox_number}vm0.maas --show-log --upload-tools
1392+juju bootstrap --to node0vm0ob${orangebox_number}.maas --show-log --upload-tools
1393 juju set-constraints "tags="
1394 juju deploy --to 0 --repository=/srv/charmstore/ local:trusty/juju-gui
1395 juju expose juju-gui
1396
1397=== modified file 'usr/bin/orange-box-create-package-mirror'
1398--- usr/bin/orange-box-create-package-mirror 2015-01-21 22:04:42 +0000
1399+++ usr/bin/orange-box-create-package-mirror 2015-07-21 17:58:26 +0000
1400@@ -27,7 +27,9 @@
1401 fi
1402
1403 home=$PWD
1404-IP=10.14.4.1
1405+. /etc/orange-box.conf
1406+
1407+IP=172.27.${orangebox_number}.1
1408
1409 function run_mirror {
1410 echo "apt-mirror /etc/apt/orange-box-mirror.list >>/var/log/orange-box-mirror.log 2>&1"
1411@@ -95,6 +97,17 @@
1412 echo Making mirror directories ...
1413 mkdir -p /srv/mirrors /srv/skel /srv/var
1414
1415+echo Creating postmirror.sh script ...
1416+# This created a blank file, for some reason :/
1417+echo << 'EOF' > /srv/var/postmirror.sh
1418+#!/bin/sh
1419+/srv/var/clean.sh
1420+EOF
1421+
1422+echo Making postmirror.sh executable ...
1423+chmod +x /srv/var/postmirror.sh
1424+echo Done. && echo
1425+
1426 echo Setting up the web dirs for mirroring ...
1427 ln -s /srv/mirrors/archive.ubuntu.com/ubuntu /var/www/html/archive.ubuntu.com
1428 ln -s /srv/mirrors/ubuntu-cloud.archive.canonical.com/ubuntu /var/www/html/ubuntu-cloud.archive.canonical.com
1429
1430=== modified file 'usr/bin/orange-box-demo-cleanup'
1431--- usr/bin/orange-box-demo-cleanup 2014-10-23 22:18:49 +0000
1432+++ usr/bin/orange-box-demo-cleanup 2015-07-21 17:58:26 +0000
1433@@ -20,6 +20,8 @@
1434
1435 ENVIRONMENT=`juju env`
1436
1437+. /etc/orange-box.conf
1438+
1439 #Destroy juju environment
1440 juju destroy-environment $ENVIRONMENT
1441 #make sure AMTs are all powered off
1442@@ -27,6 +29,6 @@
1443 if dpkg --compare-versions $maas_ver lt 1.6; then
1444 export AMT_PASSWORD=Password1+
1445 for i in $(seq 11 19); do
1446- yes | amttool 10.14.4.$i powerdown >/dev/null 2>&1
1447+ yes | amttool 172.27.${orangebox_number}.$i powerdown >/dev/null 2>&1
1448 done
1449 fi
1450
1451=== added file 'usr/bin/orange-box-hacks'
1452--- usr/bin/orange-box-hacks 1970-01-01 00:00:00 +0000
1453+++ usr/bin/orange-box-hacks 2015-07-21 17:58:26 +0000
1454@@ -0,0 +1,32 @@
1455+#!/bin/sh
1456+
1457+okay() {
1458+ echo "OK: $@"
1459+}
1460+
1461+error() {
1462+ echo "ERROR: $@"
1463+}
1464+
1465+# Check powerstate in AMT
1466+for i in $(seq 1 9); do
1467+ amtoutput=$(yes | amttool 10.14.4.1${i} info)
1468+ if [ "$amthostname" = "node${i}amt" ]; then
1469+ okay "[node${i}]: AMT is responsive"
1470+ else
1471+ error "[node${i}]: AMT is not responsive"
1472+ fi
1473+ amtpowerstate=$(echo "$amtoutput" | grep "^Powerstate:" | awk '{print $2}')
1474+ if [ -n "$amtpowerstate" ]; then
1475+ okay "[node${i}]: AMT powerstate [$amtpowerstate]"
1476+ else
1477+ error "[node${i}]: AMT powerstate unknown [$amtpowerstate]"
1478+ fi
1479+ uptime=$(ssh node$i.maas "uptime" 2>/dev/null)
1480+ if [ -n "$uptime" ]; then
1481+ okay "[node${i}]: SSH to node successful; uptime=[$uptime]"
1482+ else
1483+ error "[node${i}]: SSH to node unsuccessful; uptime=[$uptime]"
1484+ fi
1485+ echo
1486+done
1487
1488=== modified file 'usr/bin/orange-box-purge-everything'
1489--- usr/bin/orange-box-purge-everything 2014-10-08 11:51:07 +0000
1490+++ usr/bin/orange-box-purge-everything 2015-07-21 17:58:26 +0000
1491@@ -21,6 +21,7 @@
1492
1493 sudo apt-get purge $(dpkg -l | egrep "orange-box|maas|squid" | awk '{print $2}') bind9
1494 rm -rf /srv/boot-resources/* /etc/bind /root/.maascli.db
1495+rm -rf /home/ubuntu/.juju/environments/
1496 echo
1497 echo "=== IT IS HIGHLY RECOMMENDED THAT YOU REBOOT NOW! ==="
1498 echo
1499
1500=== modified file 'usr/bin/orange-box-run'
1501--- usr/bin/orange-box-run 2014-06-11 01:00:16 +0000
1502+++ usr/bin/orange-box-run 2015-07-21 17:58:26 +0000
1503@@ -24,22 +24,25 @@
1504 cmd="tail -f /var/log/cloud-init-output.log | ccze -A"
1505 fi
1506
1507-tmux new-window -n all-nodes "ssh node1.maas $cmd" \; \
1508- split-window -v "ssh node2.maas $cmd" \; \
1509- select-layout tiled \; \
1510- split-window -h "ssh node2.maas $cmd" \; \
1511- select-layout tiled \; \
1512- split-window -v "ssh node3.maas $cmd" \; \
1513- select-layout tiled \; \
1514- split-window -h "ssh node4.maas $cmd" \; \
1515- select-layout tiled \; \
1516- split-window -v "ssh node5.maas $cmd" \; \
1517- select-layout tiled \; \
1518- split-window -h "ssh node6.maas $cmd" \; \
1519- select-layout tiled \; \
1520- split-window -v "ssh node7.maas $cmd" \; \
1521- select-layout tiled \; \
1522- split-window -h "ssh node8.maas $cmd" \; \
1523- select-layout tiled \; \
1524- split-window -v "ssh node9.maas $cmd" \; \
1525+## According to OB network re-design
1526+. /etc/orange-box.conf
1527+
1528+tmux new-window -n all-nodes "ssh node1ob${orangebox_number}.maas $cmd" \; \
1529+ split-window -v "ssh node2ob${orangebox_number}.maas $cmd" \; \
1530+ select-layout tiled \; \
1531+ split-window -h "ssh node2ob${orangebox_number}.maas $cmd" \; \
1532+ select-layout tiled \; \
1533+ split-window -v "ssh node3ob${orangebox_number}.maas $cmd" \; \
1534+ select-layout tiled \; \
1535+ split-window -h "ssh node4ob${orangebox_number}.maas $cmd" \; \
1536+ select-layout tiled \; \
1537+ split-window -v "ssh node5ob${orangebox_number}.maas $cmd" \; \
1538+ select-layout tiled \; \
1539+ split-window -h "ssh node6ob${orangebox_number}.maas $cmd" \; \
1540+ select-layout tiled \; \
1541+ split-window -v "ssh node7ob${orangebox_number}.maas $cmd" \; \
1542+ select-layout tiled \; \
1543+ split-window -h "ssh node8ob${orangebox_number}.maas $cmd" \; \
1544+ select-layout tiled \; \
1545+ split-window -v "ssh node9ob${orangebox_number}.maas $cmd" \; \
1546 select-layout tiled
1547
1548=== added file 'usr/bin/orange-box-setup-nat'
1549--- usr/bin/orange-box-setup-nat 1970-01-01 00:00:00 +0000
1550+++ usr/bin/orange-box-setup-nat 2015-07-21 17:58:26 +0000
1551@@ -0,0 +1,127 @@
1552+#!/bin/bash
1553+#
1554+# orange-box-setup-nat - Setup NAT for external network access by nodes
1555+# Copyright (C) 2014 Canonical Ltd.
1556+#
1557+# Authors: Ronald McCollam <ronald.mccollam@canonical.com>
1558+# Dustin Kirkland <kirkland@canonical.com>
1559+#
1560+# This program is free software: you can redistribute it and/or modify
1561+# it under the terms of the GNU General Public License as published by
1562+# the Free Software Foundation, version 3 of the License.
1563+#
1564+# This program is distributed in the hope that it will be useful,
1565+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1566+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1567+# GNU General Public License for more details.
1568+#
1569+# You should have received a copy of the GNU General Public License
1570+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1571+
1572+set -x
1573+
1574+if [ "$(id -u)" != "0" ]; then
1575+ echo "Must be run with sudo or by root"
1576+ exit 77
1577+fi
1578+
1579+# Don't bother to restart sshd when lo is configured.
1580+if [ "$IFACE" = lo ]; then
1581+ exit 0
1582+fi
1583+
1584+# According to OB network re-design
1585+. /etc/orange-box.conf
1586+
1587+
1588+##internal=$(route -n | grep "^10\.14\." | sed -e "s/.* //")
1589+internal=$(route -n | grep "^172\.27\.${orangebox_number}\." | sed -e "s/.* //")
1590+external=$(ip route ls | grep ^default | awk '{print $5}')
1591+
1592+if [ -z "$internal" ] || [ -z "$external" ]; then
1593+ echo "usage: $0 [INTERNAL_INTERFACE] [EXTERNAL_INTERFACE]" 1>&2
1594+ exit 1
1595+fi
1596+
1597+set -e
1598+
1599+# Update MAAS upstream DNS
1600+maas admin maas set-config name=upstream_dns value=172.27.252.1 || true
1601+
1602+# Intel Centrino Advanced-N 6235 and Ubuntu don't work well with Wireless-N
1603+if lspci -v 2>/dev/null | grep -qs "Centrino Advanced-N 6235" 2>/dev/null; then
1604+ sed -i -e "/options iwlwifi 11n_disable=1/d" /etc/modprobe.d/iwlwifi.conf
1605+ echo "options iwlwifi 11n_disable=1" >> /etc/modprobe.d/iwlwifi.conf
1606+fi
1607+
1608+# Configure NAT and IP forwarding, giving slave NUCs external network access
1609+# through the master.
1610+
1611+# Enable IP forwarding and save for next boot
1612+echo 1 > /proc/sys/net/ipv4/ip_forward
1613+echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/10-maas-ip-forward.conf
1614+echo "net.ipv4.conf.all.accept_redirects=1 >> /etc/sysctl.d/10-maas-ip-forward.conf"
1615+echo "net.ipv6.conf.all.accept_redirects=1 >> /etc/sysctl.d/10-maas-ip-forward.conf"
1616+echo "net.ipv4.conf.all.send_redirects=1 >> /etc/sysctl.d/10-maas-ip-forward.conf"
1617+sysctl --system
1618+
1619+#Create the static ip tables for multi OBs.
1620+cat > /etc/rc.local <<EOF
1621+#!/bin/sh -e
1622+#
1623+# rc.local
1624+#
1625+# This script is executed at the end of each multiuser runlevel.
1626+# Make sure that the script will "exit 0" on success or any other
1627+# value on error.
1628+#
1629+# In order to enable or disable this script just change the execution
1630+# bits.
1631+#
1632+# By default this script does nothing.
1633+
1634+EOF
1635+for obn in `seq 4 4 80`
1636+do
1637+ [[ $obn == ${orangebox_number} ]] ||echo " ip route add 172.27.$obn.0/22 via 172.27.252.$obn " >> /etc/rc.local
1638+done
1639+echo "exit 0" >> /etc/rc.local
1640+
1641+# Note that this script assumes no existing iptables rules. If you do have
1642+# any, they will be deleted.
1643+iptables --flush
1644+iptables --table nat --flush
1645+iptables --delete-chain
1646+iptables --table nat --delete-chain
1647+
1648+# Firewalling this machine
1649+# Allow incoming SSH
1650+iptables -A INPUT -i $external -p tcp --dport 22 -j ACCEPT
1651+iptables -A INPUT -i $external -m state --state ESTABLISHED,RELATED -j ACCEPT
1652+###iptables -A INPUT -i $external -j DROP
1653+
1654+# Some things use the MAAS proxy - some things don't. So turn on NAT.
1655+echo "Setting up ip forwarding"
1656+iptables -t nat -A POSTROUTING -o $external -j MASQUERADE
1657+iptables -A FORWARD -i $external -o $internal -m state --state RELATED,ESTABLISHED -j ACCEPT
1658+iptables -A FORWARD -i $internal -o $external -j ACCEPT
1659+# The following line sets up a transparent proxy
1660+iptables -A PREROUTING -t nat -i br0 -p tcp -m multiport --dports 80 -j REDIRECT --to-port 3128
1661+
1662+iptables-save > /etc/iptables/rules.v4
1663+
1664+# 14.10 deprecates the iptables-persistent service in favor of netfilter-persistent
1665+service iptables-persistent restart || service netfilter-persistent restart
1666+
1667+# It seems we need to restart squid3 after making these network changes
1668+maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
1669+if dpkg --compare-versions $maas_ver lt 1.6; then
1670+# We now run squid3, and NOT squid-deb-proxy
1671+ update-rc.d -f squid-deb-proxy remove || true
1672+ service squid-deb-proxy stop || true
1673+ service squid3 stop || true
1674+ service squid3 start
1675+else
1676+ service maas-proxy stop || true
1677+ service maas-proxy start || true
1678+fi
1679
1680=== removed file 'usr/bin/orange-box-setup-nat'
1681--- usr/bin/orange-box-setup-nat 2014-10-08 11:51:07 +0000
1682+++ usr/bin/orange-box-setup-nat 1970-01-01 00:00:00 +0000
1683@@ -1,99 +0,0 @@
1684-#!/bin/bash
1685-#
1686-# orange-box-setup-nat - Setup NAT for external network access by nodes
1687-# Copyright (C) 2014 Canonical Ltd.
1688-#
1689-# Authors: Ronald McCollam <ronald.mccollam@canonical.com>
1690-# Dustin Kirkland <kirkland@canonical.com>
1691-#
1692-# This program is free software: you can redistribute it and/or modify
1693-# it under the terms of the GNU General Public License as published by
1694-# the Free Software Foundation, version 3 of the License.
1695-#
1696-# This program is distributed in the hope that it will be useful,
1697-# but WITHOUT ANY WARRANTY; without even the implied warranty of
1698-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1699-# GNU General Public License for more details.
1700-#
1701-# You should have received a copy of the GNU General Public License
1702-# along with this program. If not, see <http://www.gnu.org/licenses/>.
1703-
1704-set -x
1705-
1706-if [ "$(id -u)" != "0" ]; then
1707- echo "Must be run with sudo or by root"
1708- exit 77
1709-fi
1710-
1711-# Don't bother to restart sshd when lo is configured.
1712-if [ "$IFACE" = lo ]; then
1713- exit 0
1714-fi
1715-
1716-internal=$(route -n | grep "^10\.14\." | sed -e "s/.* //")
1717-external=$(ip route ls | grep ^default | awk '{print $5}')
1718-
1719-
1720-if [ -z "$internal" ] || [ -z "$external" ]; then
1721- echo "usage: $0 [INTERNAL_INTERFACE] [EXTERNAL_INTERFACE]" 1>&2
1722- exit 1
1723-fi
1724-
1725-set -e
1726-
1727-# Update MAAS upstream DNS
1728-dns=$(nmcli d list iface $external | grep -m 1 "^IP4.DNS" | awk '{ print $2 }')
1729-maas admin maas set-config name=upstream_dns value=$dns || true
1730-
1731-# Intel Centrino Advanced-N 6235 and Ubuntu don't work well with Wireless-N
1732-if lspci -v 2>/dev/null | grep -qs "Centrino Advanced-N 6235" 2>/dev/null; then
1733- sed -i -e "/options iwlwifi 11n_disable=1/d" /etc/modprobe.d/iwlwifi.conf
1734- echo "options iwlwifi 11n_disable=1" >> /etc/modprobe.d/iwlwifi.conf
1735-fi
1736-
1737-# Configure NAT and IP forwarding, giving slave NUCs external network access
1738-# through the master.
1739-
1740-# Enable IP forwarding and save for next boot
1741-echo 1 > /proc/sys/net/ipv4/ip_forward
1742-echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/10-maas-ip-forward.conf
1743-sysctl --system
1744-
1745-# Note that this script assumes no existing iptables rules. If you do have
1746-# any, they will be deleted.
1747-iptables --flush
1748-iptables --table nat --flush
1749-iptables --delete-chain
1750-iptables --table nat --delete-chain
1751-
1752-# Firewalling this machine
1753-# Allow incoming SSH
1754-iptables -A INPUT -i $external -p tcp --dport 22 -j ACCEPT
1755-iptables -A INPUT -i $external -m state --state ESTABLISHED,RELATED -j ACCEPT
1756-iptables -A INPUT -i $external -j DROP
1757-
1758-# Some things use the MAAS proxy - some things don't. So turn on NAT.
1759-echo "Setting up ip forwarding"
1760-iptables -t nat -A POSTROUTING -o $external -j MASQUERADE
1761-iptables -A FORWARD -i $external -o $internal -m state --state RELATED,ESTABLISHED -j ACCEPT
1762-iptables -A FORWARD -i $internal -o $external -j ACCEPT
1763-# The following line sets up a transparent proxy
1764-iptables -A PREROUTING -t nat -i br0 -p tcp -m multiport --dports 80 -j REDIRECT --to-port 3128
1765-
1766-iptables-save > /etc/iptables/rules.v4
1767-
1768-# 14.10 deprecates the iptables-persistent service in favor of netfilter-persistent
1769-service iptables-persistent restart || service netfilter-persistent restart
1770-
1771-# It seems we need to restart squid3 after making these network changes
1772-maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
1773-if dpkg --compare-versions $maas_ver lt 1.6; then
1774-# We now run squid3, and NOT squid-deb-proxy
1775- update-rc.d -f squid-deb-proxy remove || true
1776- service squid-deb-proxy stop || true
1777- service squid3 stop || true
1778- service squid3 start
1779-else
1780- service maas-proxy stop || true
1781- service maas-proxy start || true
1782-fi
1783
1784=== modified file 'usr/bin/orange-box-status-all-nodes'
1785--- usr/bin/orange-box-status-all-nodes 2014-10-20 11:58:14 +0000
1786+++ usr/bin/orange-box-status-all-nodes 2015-07-21 17:58:26 +0000
1787@@ -22,6 +22,9 @@
1788 export AMT_PASSWORD=Password1+
1789 ERRORS=0
1790
1791+## According to OB network re-design
1792+. /etc/orange-box.conf
1793+
1794 okay() {
1795 echo "OK: $@"
1796 }
1797@@ -35,23 +38,23 @@
1798 status_all_nodes() {
1799 # Check all VM nodes
1800 for i in $(seq 0 2); do
1801- if virsh list --all | grep node0vm${i} | grep running >/dev/null 2>&1; then
1802- okay "[node0vm${i}]: Is running"
1803- uptime=$(ssh node0vm${i}.maas "uptime" 2>/dev/null)
1804+ if virsh list --all | grep node0ob${orangebox_number}vm${i} | grep running >/dev/null 2>&1; then
1805+ okay "[node0ob${orangebox_number}vm${i}]: Is running"
1806+ uptime=$(ssh node0ob${orangebox_number}vm${i}.maas "uptime" 2>/dev/null)
1807 if [ -n "$uptime" ]; then
1808- okay "[node0vm${i}]: SSH to node successful; uptime=[$uptime]"
1809+ okay "[node0ob${orangebox_number}vm${i}]: SSH to node successful; uptime=[$uptime]"
1810 else
1811- error "[node0vm${i}]: SSH to node unsuccessful; uptime=[$uptime]"
1812+ error "[node0ob${orangebox_number}vm${i}]: SSH to node unsuccessful; uptime=[$uptime]"
1813 fi
1814 else
1815- error "[node0vm${i}]: Is not running"
1816+ error "[node0ob${orangebox_number}vm${i}]: Is not running"
1817 fi
1818 done
1819 # Check all AMT nodes
1820 for i in $(seq 1 9); do
1821- hostname="node${i}.maas"
1822+ hostname="node${i}ob${orangebox_number}.maas"
1823 # (1) Ping AMT IP Addresses
1824- amt_ip="10.14.4.1$i"
1825+ amt_ip="172.27.${orangebox_number}.1$i"
1826 if ping -c 1 -q $amt_ip >/dev/null 2>&1; then
1827 okay "[$hostname]: AMT responding to ping [$amt_ip]"
1828 else

Subscribers

People subscribed via source and target branches