Merge lp:~nii/nova/nova-deployment-tool into lp:~hudson-openstack/nova/trunk
- nova-deployment-tool
- Merge into trunk
Status: | Rejected |
---|---|
Rejected by: | Soren Hansen |
Proposed branch: | lp:~nii/nova/nova-deployment-tool |
Merge into: | lp:~hudson-openstack/nova/trunk |
Diff against target: |
899 lines (+807/-0) 17 files modified
contrib/nova-deployment-tool2011/Readme (+24/-0) contrib/nova-deployment-tool2011/conf/deploy.conf (+12/-0) contrib/nova-deployment-tool2011/conf/etc-default/puppetmaster (+38/-0) contrib/nova-deployment-tool2011/conf/flags.conf (+3/-0) contrib/nova-deployment-tool2011/conf/logging.conf (+34/-0) contrib/nova-deployment-tool2011/conf/puppet-server/autosign.conf (+1/-0) contrib/nova-deployment-tool2011/conf/puppet-server/fileserver.conf (+18/-0) contrib/nova-deployment-tool2011/conf/puppet-server/puppet.conf (+19/-0) contrib/nova-deployment-tool2011/deploy.py (+367/-0) contrib/nova-deployment-tool2011/files/external_nodes.py (+44/-0) contrib/nova-deployment-tool2011/files/mysql-init.sh (+14/-0) contrib/nova-deployment-tool2011/files/mysql-preseed.sh (+13/-0) contrib/nova-deployment-tool2011/manifests/site.pp (+114/-0) contrib/nova-deployment-tool2011/setup-network.sh (+8/-0) contrib/nova-deployment-tool2011/templates/nova.conf.erb (+32/-0) contrib/nova-deployment-tool2011/test.sh (+43/-0) contrib/nova-deployment-tool2011/uninstall.sh (+23/-0) |
To merge this branch: | bzr merge lp:~nii/nova/nova-deployment-tool |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Soren Hansen (community) | Disapprove | ||
Thierry Carrez | Pending | ||
Jesse Andrews | Pending | ||
Review via email:
|
Commit message
Description of the change
First Merge proposal to trunk. I add a directory in the contrib directory, named nova-deployment
Tentative Manual will be uploaded within a week.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Todd Willey (xtoddx) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Soren Hansen (soren) wrote : | # |
By accepting this into trunk, it's implied that it will be kept up-to-date, given that people checking out trunk will actually be able to find it as part of the checkout. I know that *I* will not be maintaining it. Unless you can find a nova-core person that will volunteer to keep this up-to-date (or at the very least pull it out once it becomes out-dated (which won't be long at the pace this project moves)), I can't approve it. Sorry.
Just to be clear, this has nothing to do with the quality of your work (I've only glanced at it). This is about ensuring the future coherence of trunk.
Disapproving for now, but if you can find a nova-core person that will promise to keep it up-to-date, I'm very willing to reconsider.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Shigetoshi Yokoyama (yoko) wrote : | # |
> By accepting this into trunk, it's implied that it will be kept up-to-date,
> given that people checking out trunk will actually be able to find it as part
> of the checkout. I know that *I* will not be maintaining it. Unless you can
> find a nova-core person that will volunteer to keep this up-to-date (or at the
> very least pull it out once it becomes out-dated (which won't be long at the
> pace this project moves)), I can't approve it. Sorry.
>
> Just to be clear, this has nothing to do with the quality of your work (I've
> only glanced at it). This is about ensuring the future coherence of trunk.
>
> Disapproving for now, but if you can find a nova-core person that will promise
> to keep it up-to-date, I'm very willing to reconsider.
I appreciate that you navigate me, informatively. I think our contribution is
close to the puppet tool which is put under the contrib directory by some of
NASA members.
I have been talking to Jesse and Todd on this deployment tool issues since my
blueprint proposal. I suppose I should ask them to be the volunteer.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vish Ishaya (vishvananda) wrote : | # |
I don't really see a problem with it going into contrib. We don't
really have a good other location for items like this.
On Wednesday, January 12, 2011, Shigetoshi Yokoyama <email address hidden> wrote:
>> By accepting this into trunk, it's implied that it will be kept up-to-date,
>> given that people checking out trunk will actually be able to find it as part
>> of the checkout. I know that *I* will not be maintaining it. Unless you can
>> find a nova-core person that will volunteer to keep this up-to-date (or at the
>> very least pull it out once it becomes out-dated (which won't be long at the
>> pace this project moves)), I can't approve it. Sorry.
>>
>> Just to be clear, this has nothing to do with the quality of your work (I've
>> only glanced at it). This is about ensuring the future coherence of trunk.
>>
>> Disapproving for now, but if you can find a nova-core person that will promise
>> to keep it up-to-date, I'm very willing to reconsider.
>
> I appreciate that you navigate me, informatively. I think our contribution is
> close to the puppet tool which is put under the contrib directory by some of
> NASA members.
> I have been talking to Jesse and Todd on this deployment tool issues since my
> blueprint proposal. I suppose I should ask them to be the volunteer.
>
>
> --
> https:/
> You are subscribed to branch lp:nova.
>
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Shigetoshi Yokoyama (yoko) wrote : | # |
> The files that have a copyright header probably also need the standard apache
> license header used throughout the project.
I thank you for the comment. I will follow it when I update the code, around 24th of Jan.
BTW, this merge proposal was 'temporally' disapproved by Soren until I find a volunteer
in nova-core team. Of course, I have a commitment to make the code update but I need
your help to be the volunteer in oder to get an approval. Could you kindly become the
person?
I hope this version is close to what you wanted to have, using puppet external node
functionality. We are now writing a manual for this tool and doing user test with it.
I will update the code and put this manual in wiki, next Monday. -- yoko
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Soren Hansen (soren) wrote : | # |
> I don't really see a problem with it going into contrib. We don't
> really have a good other location for items like this.
I believe we do. It's called "outside".
If people can check out trunk and find 7 different sets of deployment tools, none of which work, because none of them are kept up-to-date, everybody loses. The user wanting use install and run Nova doesn't get what they want, and we potentially lose a new user. If people want to get stuff into our trunk, they have to commit to keeping it up-to-date. Getting a nova-core person to vouch for that commitment guarantees that someone who actively follows what goes on in trunk every day looks after it.
A quick glance at this tool reveals that it's already out of date. It's still referencing a bunch of libvirt templates that no longer exist, and the one that remains isn't installed where this tool expects it to. I don't blame the author, because this project moves so fast, it's really, really hard to keep this stuff up-to-date.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Shigetoshi Yokoyama (yoko) wrote : | # |
> > I don't really see a problem with it going into contrib. We don't
> > really have a good other location for items like this.
>
> I believe we do. It's called "outside".
>
> If people can check out trunk and find 7 different sets of deployment tools,
> none of which work, because none of them are kept up-to-date, everybody loses.
> The user wanting use install and run Nova doesn't get what they want, and we
> potentially lose a new user. If people want to get stuff into our trunk, they
> have to commit to keeping it up-to-date. Getting a nova-core person to vouch
> for that commitment guarantees that someone who actively follows what goes on
> in trunk every day looks after it.
>
> A quick glance at this tool reveals that it's already out of date. It's still
> referencing a bunch of libvirt templates that no longer exist, and the one
> that remains isn't installed where this tool expects it to. I don't blame the
> author, because this project moves so fast, it's really, really hard to keep
> this stuff up-to-date.
I have a commitment to make the code up-to-date when we release for Bexar. So,
I am expecting to be very tough days just before 3rd of Mar. As Soren says, I
think it's really, really hard to keep this stuff up-to-date anytime, even after
the release.
However, I believe that if it is up-to-date to the release version,
tools 'inside' the release makes sense in terms of user benefits. We should
inform aim of tool by which users can know which is fit to their needs.
I did not know any other ways than to follow the procedure, which I was taught,
in order to contribute to the community.
1) Write a Blueprint
2) Present it at the developer conference
3) Get an Approval to it
4) Upload codes
5) Propose merge to trunk by 6th of Jan.
6) Get an Approval to it
I am now asking Todd to become a volunteer following Sore's advice. Please
help me to find a way to contribute the code for openstack users' value.
I was thinking that the tool would make installation easier and help everybody
wins. -- yoko
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Soren Hansen (soren) wrote : | # |
>>> I don't really see a problem with it going into contrib. We don't
>>> really have a good other location for items like this.
>> I believe we do. It's called "outside".
I think to a great extent this is the problem we need to address. My primary
concern is related to having this in trunk. Trunk is very much a moving target.
If this stuff is only going to be updated ocasionally (perhaps in sync with
various freezes or whatnot), that means it'll be out-of-date most of the
time. To me, this means it belongs somewhere else. Not necessarily outside of
OpenStack, but outside of Nova's trunk.
If this is the one tool we're going to use, and the one set of puppet recipes
we're going to encourage people to use, I have no problem "advertising" it on
the front page of the wiki, on the Launchpad page for Nova, etc. etc.
> I have a commitment to make the code up-to-date when we release for
> Bexar. So, I am expecting to be very tough days just before 3rd of
> Mar. As Soren says, I think it's really, really hard to keep this
> stuff up-to-date anytime, even after the release.
That's another good reason why you may want to keep this separate from
trunk. If you expect to keep adjusting it after release, you can't do
that if it's in trunk. We're not going to release new tarballs of Nova
itself to publish new puppet recipes.
> We should inform aim of tool by which users can know which is fit to
> their needs.
Yes. See below.
> I did not know any other ways than to follow the procedure, which I
> was taught, in order to contribute to the community.
You've done nothing wrong :) I really do appreciate the contribution
and I'm not meaning to reject your work. I'm just don't believe the
specific location for it (Nova's trunk) is what is best for neither your
work, nor Nova. Imagine this scenario: You make sure the scripts and
the recipes are in perfect order by the time of Bexar's release. The
next day, we make some changes on trunk that are incompatible with your
scripts. People checking out trunk will still find your recipes, try
them, and find that they do not give them a functional cloud. They
either blame you, because they can see that you provided the recipes, or
they blame the entire OpenStack project. That doesn't help anyone at
all.
In summary, if this is in Nova's trunk, it needs to be up-to-date. If
it's kept somewhere else (maybe in a separate "nova-deployment" project
on Launchpad under the OpenStack umbrella) it's easier to have it say
"This tool is for deploying OpenStack Bexar" so that people know exactly
what to expect.
> 1) Write a Blueprint
> 2) Present it at the developer conference
> 3) Get an Approval to it
> 4) Upload codes
> 5) Propose merge to trunk by 6th of Jan.
> 6) Get an Approval to it
Yup, this looks correct to me. Again, you did nothing wrong. :)
> I am now asking Todd to become a volunteer following Sore's advice.
> Please help me to find a way to contribute the code for openstack
> users' value.
>
> I was thinking that the tool would make installation easier and help everybody
> wins. -- yoko
I completely agree. I think this could also serve well as a tool for
automated full-scale testing. It's good stuff! My onl...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Soren Hansen (soren) wrote : | # |
As an interesting data point, the packaging code for Ubuntu isn't in Nova's trunk either. It's not even kept under the nova project on Launchpad.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Thierry Carrez (ttx) wrote : | # |
I agree it is probably better for everyone to have this very interesting OpenStack contribution land into its own OpenStack project, rather than in nova core trunk.
You will have to adjust the deployment tool until the very last minute before release, which is difficult to do with the freezes we impose on the core code. Your tool is, like the Ubuntu packaging rules, the Nova web UI or the iOS clients, a consumer of a stable Nova core code. As such it makes much more sense from a release perspective to have its own project, rather than artificially impose the core release freezes onto your own development.
If you agree with that, we can help you setting up the separate launchpad project under the Openstack umbrella. As far as discoverability goes, if the documentation is updated to reference the tool, I'm pretty sure people will be able to easily find it.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vish Ishaya (vishvananda) wrote : | # |
Soren made some excellent points. I am convinced that it is probably best to put this into its own launchpad project.
Vish
On Jan 13, 2011, at 5:11 AM, Thierry Carrez wrote:
> I agree it is probably better for everyone to have this very interesting OpenStack contribution land into its own OpenStack project, rather than in nova core trunk.
>
> You will have to adjust the deployment tool until the very last minute before release, which is difficult to do with the freezes we impose on the core code. Your tool is, like the Ubuntu packaging rules, the Nova web UI or the iOS clients, a consumer of a stable Nova core code. As such it makes much more sense from a release perspective to have its own project, rather than artificially impose the core release freezes onto your own development.
>
> If you agree with that, we can help you setting up the separate launchpad project under the Openstack umbrella. As far as discoverability goes, if the documentation is updated to reference the tool, I'm pretty sure people will be able to easily find it.
> --
> https:/
> You are subscribed to branch lp:nova.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Shigetoshi Yokoyama (yoko) wrote : | # |
> >>> I don't really see a problem with it going into contrib. We don't
> >>> really have a good other location for items like this.
> >> I believe we do. It's called "outside".
>
> I think to a great extent this is the problem we need to address. My primary
> concern is related to having this in trunk. Trunk is very much a moving
> target.
> If this stuff is only going to be updated ocasionally (perhaps in sync with
> various freezes or whatnot), that means it'll be out-of-date most of the
> time. To me, this means it belongs somewhere else. Not necessarily outside of
> OpenStack, but outside of Nova's trunk.
>
> If this is the one tool we're going to use, and the one set of puppet recipes
> we're going to encourage people to use, I have no problem "advertising" it on
> the front page of the wiki, on the Launchpad page for Nova, etc. etc.
>
> > I have a commitment to make the code up-to-date when we release for
> > Bexar. So, I am expecting to be very tough days just before 3rd of
> > Mar. As Soren says, I think it's really, really hard to keep this
> > stuff up-to-date anytime, even after the release.
>
> That's another good reason why you may want to keep this separate from
> trunk. If you expect to keep adjusting it after release, you can't do
> that if it's in trunk. We're not going to release new tarballs of Nova
> itself to publish new puppet recipes.
>
> > We should inform aim of tool by which users can know which is fit to
> > their needs.
>
> Yes. See below.
>
> > I did not know any other ways than to follow the procedure, which I
> > was taught, in order to contribute to the community.
>
> You've done nothing wrong :) I really do appreciate the contribution
> and I'm not meaning to reject your work. I'm just don't believe the
> specific location for it (Nova's trunk) is what is best for neither your
> work, nor Nova. Imagine this scenario: You make sure the scripts and
> the recipes are in perfect order by the time of Bexar's release. The
> next day, we make some changes on trunk that are incompatible with your
> scripts. People checking out trunk will still find your recipes, try
> them, and find that they do not give them a functional cloud. They
> either blame you, because they can see that you provided the recipes, or
> they blame the entire OpenStack project. That doesn't help anyone at
> all.
>
> In summary, if this is in Nova's trunk, it needs to be up-to-date. If
> it's kept somewhere else (maybe in a separate "nova-deployment" project
> on Launchpad under the OpenStack umbrella) it's easier to have it say
> "This tool is for deploying OpenStack Bexar" so that people know exactly
> what to expect.
>
> > 1) Write a Blueprint
> > 2) Present it at the developer conference
> > 3) Get an Approval to it
> > 4) Upload codes
> > 5) Propose merge to trunk by 6th of Jan.
> > 6) Get an Approval to it
>
> Yup, this looks correct to me. Again, you did nothing wrong. :)
>
> > I am now asking Todd to become a volunteer following Sore's advice.
> > Please help me to find a way to contribute the code for openstack
> > users' value.
> >
> > I was thinking that the tool would make installation easier and help
> everybody
> > win...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Shigetoshi Yokoyama (yoko) wrote : | # |
> I agree it is probably better for everyone to have this very interesting
> OpenStack contribution land into its own OpenStack project, rather than in
> nova core trunk.
>
> You will have to adjust the deployment tool until the very last minute before
> release, which is difficult to do with the freezes we impose on the core code.
> Your tool is, like the Ubuntu packaging rules, the Nova web UI or the iOS
> clients, a consumer of a stable Nova core code. As such it makes much more
> sense from a release perspective to have its own project, rather than
> artificially impose the core release freezes onto your own development.
>
> If you agree with that, we can help you setting up the separate launchpad
> project under the Openstack umbrella. As far as discoverability goes, if the
> documentation is updated to reference the tool, I'm pretty sure people will be
> able to easily find it.
I agree that it is better for everyone to put our code into a separate launchpad
project under the Openstack umbrella. I appreciate that you said you could help
it. Actually, Anne has been helping us to put our documentation as well and it
is now in http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Shigetoshi Yokoyama (yoko) wrote : | # |
I thank your feedback. It made me be able to move forward. -- yoko
> Soren made some excellent points. I am convinced that it is probably best to
> put this into its own launchpad project.
>
> Vish
>
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Soren Hansen (soren) wrote : | # |
Alright, it seems we're in agreement. This will be merged in a separate project, so I'm rejecting this merge proposal in Nova.
Unmerged revisions
- 471. By Shigetoshi Yokoyama
-
Initial import
- 470. By Shigetoshi Yokoyama
-
Initial import
Preview Diff
1 | === added directory 'contrib/nova-deployment-tool2011' |
2 | === added file 'contrib/nova-deployment-tool2011/Readme' |
3 | --- contrib/nova-deployment-tool2011/Readme 1970-01-01 00:00:00 +0000 |
4 | +++ contrib/nova-deployment-tool2011/Readme 2011-01-06 09:41:56 +0000 |
5 | @@ -0,0 +1,24 @@ |
6 | +1. Before installation |
7 | + |
8 | +You should do the following steps before installation. |
9 | +Attention: replace $USER_NAME with the real user name. |
10 | + |
11 | +1.1 Append the following line to the end of sudoers via visudo. |
12 | +$USER_NAME ALL=(ALL) NOPASSWD:ALL |
13 | + |
14 | +1.2 Create authentication keys. Leave key file as default value, and leave passphrase as empty. |
15 | +ssh-keygen -t rsa |
16 | + |
17 | +1.3 Add authentication key. |
18 | +cat /home/$USER_NAME/.ssh/id_rsa.pub >> /home/$USER_NAME/.ssh/authorized_keys |
19 | + |
20 | +1.4 Confirm that no password is needed when executing command "sudo -i". |
21 | + |
22 | +1.5 Confirm that no password is needed when executing command "ssh $USER_NAME@127.0.0.1". |
23 | + |
24 | + |
25 | +2. Installation |
26 | + |
27 | +2.1 Execute deploy.py. |
28 | + |
29 | + |
30 | |
31 | === added directory 'contrib/nova-deployment-tool2011/conf' |
32 | === added file 'contrib/nova-deployment-tool2011/conf/deploy.conf' |
33 | --- contrib/nova-deployment-tool2011/conf/deploy.conf 1970-01-01 00:00:00 +0000 |
34 | +++ contrib/nova-deployment-tool2011/conf/deploy.conf 2011-01-06 09:41:56 +0000 |
35 | @@ -0,0 +1,12 @@ |
36 | +nova_api=ubuntu1 |
37 | +nova_objectstore=ubuntu1 |
38 | +nova_compute=ubuntu3 |
39 | +nova_scheduler=ubuntu4 |
40 | +nova_network=ubuntu5 |
41 | +nova_volume=ubuntu6 |
42 | +euca2ools=ubuntu1 |
43 | + |
44 | +mysql=ubuntu1 |
45 | +puppet_server=ubuntu7 |
46 | + |
47 | +ssh_user=nii |
48 | |
49 | === added directory 'contrib/nova-deployment-tool2011/conf/etc-default' |
50 | === added file 'contrib/nova-deployment-tool2011/conf/etc-default/puppetmaster' |
51 | --- contrib/nova-deployment-tool2011/conf/etc-default/puppetmaster 1970-01-01 00:00:00 +0000 |
52 | +++ contrib/nova-deployment-tool2011/conf/etc-default/puppetmaster 2011-01-06 09:41:56 +0000 |
53 | @@ -0,0 +1,38 @@ |
54 | +# Defaults for puppetmaster - sourced by /etc/init.d/puppetmaster |
55 | + |
56 | +# Start puppetmaster on boot? If you are using passenger, you should |
57 | +# have this set to "no" |
58 | +START=yes |
59 | + |
60 | +# Startup options |
61 | +DAEMON_OPTS="" |
62 | + |
63 | +# What server type to run |
64 | +# Options: |
65 | +# webrick: default, cannot handle more than ~30 nodes |
66 | +# mongrel: scales better than webrick because you can run |
67 | +# multiple processes if you are getting |
68 | +# connection-reset or End-of-file errors, switch to |
69 | +# mongrel. Requires front-end web-proxy such as |
70 | +# apache, nginx, or pound, more information: |
71 | +# http://reductivelabs.com/trac/puppet/wiki/UsingMongrel |
72 | +# passenger: no need to set this, be sure to set START=no above |
73 | +SERVERTYPE=webrick |
74 | + |
75 | +# How many puppetmaster instances to start? Its pointless to set this |
76 | +# higher than 1 if you are not using mongrel. |
77 | +PUPPETMASTERS=1 |
78 | + |
79 | +# What port should the puppetmaster listen on (default: 8140). If |
80 | +# PUPPETMASTERS is set to a number greater than 1, then the port for |
81 | +# the first puppetmaster will be set to the port listed below, and |
82 | +# further instances will be incremented by one |
83 | +# |
84 | +# NOTE: if you are using mongrel, then you will need to have a |
85 | +# front-end web-proxy (such as apache, nginx, pound) that takes |
86 | +# incoming requests on the port your clients are connecting to |
87 | +# (default is: 8140), and then passes them off to the mongrel |
88 | +# processes. In this case it is recommended to run your web-proxy on |
89 | +# port 8140 and change the below number to something else, such as |
90 | +# 18140. |
91 | +PORT=8140 |
92 | |
93 | === added file 'contrib/nova-deployment-tool2011/conf/flags.conf' |
94 | --- contrib/nova-deployment-tool2011/conf/flags.conf 1970-01-01 00:00:00 +0000 |
95 | +++ contrib/nova-deployment-tool2011/conf/flags.conf 2011-01-06 09:41:56 +0000 |
96 | @@ -0,0 +1,3 @@ |
97 | +--volume_group=ubuntu3 |
98 | +--fixed_range=192.168.2.64/26 |
99 | +--network_size=64 |
100 | |
101 | === added file 'contrib/nova-deployment-tool2011/conf/logging.conf' |
102 | --- contrib/nova-deployment-tool2011/conf/logging.conf 1970-01-01 00:00:00 +0000 |
103 | +++ contrib/nova-deployment-tool2011/conf/logging.conf 2011-01-06 09:41:56 +0000 |
104 | @@ -0,0 +1,34 @@ |
105 | +[loggers] |
106 | +keys=root,deploy |
107 | + |
108 | +[handlers] |
109 | +keys=consoleHandler,fileHandler |
110 | + |
111 | +[formatters] |
112 | +keys=simpleFormatter |
113 | + |
114 | +[logger_root] |
115 | +handlers= |
116 | + |
117 | +[logger_deploy] |
118 | +level=DEBUG |
119 | +handlers=consoleHandler,fileHandler |
120 | +qualName=deploy |
121 | + |
122 | +[handler_consoleHandler] |
123 | +class=StreamHandler |
124 | +level=DEBUG |
125 | +formatter=simpleFormatter |
126 | +args=(sys.stdout,) |
127 | + |
128 | +[handler_fileHandler] |
129 | +class=FileHandler |
130 | +level=DEBUG |
131 | +formatter=simpleFormatter |
132 | +args=('log/deploy.log', 'w') |
133 | +filename=deploy.log |
134 | +mode=w |
135 | + |
136 | +[formatter_simpleFormatter] |
137 | +format=%(asctime)s - %(levelname)s - %(message)s |
138 | +datefmt= |
139 | |
140 | === added directory 'contrib/nova-deployment-tool2011/conf/puppet-server' |
141 | === added file 'contrib/nova-deployment-tool2011/conf/puppet-server/autosign.conf' |
142 | --- contrib/nova-deployment-tool2011/conf/puppet-server/autosign.conf 1970-01-01 00:00:00 +0000 |
143 | +++ contrib/nova-deployment-tool2011/conf/puppet-server/autosign.conf 2011-01-06 09:41:56 +0000 |
144 | @@ -0,0 +1,1 @@ |
145 | +* |
146 | |
147 | === added file 'contrib/nova-deployment-tool2011/conf/puppet-server/fileserver.conf' |
148 | --- contrib/nova-deployment-tool2011/conf/puppet-server/fileserver.conf 1970-01-01 00:00:00 +0000 |
149 | +++ contrib/nova-deployment-tool2011/conf/puppet-server/fileserver.conf 2011-01-06 09:41:56 +0000 |
150 | @@ -0,0 +1,18 @@ |
151 | +# This file consists of arbitrarily named sections/modules |
152 | +# defining where files are served from and to whom |
153 | + |
154 | +# Define a section 'files' |
155 | +# Adapt the allow/deny settings to your needs. Order |
156 | +# for allow/deny does not matter, allow always takes precedence |
157 | +# over deny |
158 | +[files] |
159 | + path /etc/puppet/files |
160 | + allow * |
161 | +# allow *.example.com |
162 | +# deny *.evil.example.com |
163 | +# allow 192.168.0.0/24 |
164 | + |
165 | +[plugins] |
166 | +# allow *.example.com |
167 | +# deny *.evil.example.com |
168 | +# allow 192.168.0.0/24 |
169 | |
170 | === added file 'contrib/nova-deployment-tool2011/conf/puppet-server/puppet.conf' |
171 | --- contrib/nova-deployment-tool2011/conf/puppet-server/puppet.conf 1970-01-01 00:00:00 +0000 |
172 | +++ contrib/nova-deployment-tool2011/conf/puppet-server/puppet.conf 2011-01-06 09:41:56 +0000 |
173 | @@ -0,0 +1,19 @@ |
174 | +[main] |
175 | +logdir=/var/log/puppet |
176 | +vardir=/var/lib/puppet |
177 | +ssldir=/var/lib/puppet/ssl |
178 | +rundir=/var/run/puppet |
179 | +factpath=$vardir/lib/facter |
180 | +templatedir=$confdir/templates |
181 | +#prerun_command=/etc/puppet/etckeeper-commit-pre |
182 | +#postrun_command=/etc/puppet/etckeeper-commit-post |
183 | + |
184 | +external_nodes = /etc/puppet/files/external_nodes.py |
185 | +node_terminus = exec |
186 | + |
187 | +[master] |
188 | +# These are needed when the puppetmaster is run by passenger |
189 | +# and can safely be removed if webrick is used. |
190 | +ssl_client_header = SSL_CLIENT_S_DN |
191 | +ssl_client_verify_header = SSL_CLIENT_VERIFY |
192 | + |
193 | |
194 | === added file 'contrib/nova-deployment-tool2011/deploy.py' |
195 | --- contrib/nova-deployment-tool2011/deploy.py 1970-01-01 00:00:00 +0000 |
196 | +++ contrib/nova-deployment-tool2011/deploy.py 2011-01-06 09:41:56 +0000 |
197 | @@ -0,0 +1,367 @@ |
198 | +#! /usr/bin/python |
199 | +# vim: tabstop=4 shiftwidth=4 softtabstop=4 |
200 | + |
201 | +# |
202 | +# Copyright (c) National Institute of Informatics 2010 All rights reserved. |
203 | +# |
204 | + |
205 | + |
206 | +""" |
207 | +Install nova into single machine or multiple machines |
208 | +""" |
209 | + |
210 | +import logging |
211 | +import logging.config |
212 | +import os |
213 | +import commands |
214 | +import time |
215 | +import sys |
216 | +import traceback |
217 | + |
218 | +TOOL_HOME = os.path.abspath(os.path.dirname(__file__)) |
219 | +COMPONENTS = ["mysql", "nova_api", "nova_objectstore", "nova_compute", |
220 | + "nova_scheduler", "nova_network", "nova_volume", "euca2ools"] |
221 | +CONF = {} |
222 | + |
223 | +os.chdir(TOOL_HOME) |
224 | + |
225 | +#initialize LOGGER |
226 | +logging.config.fileConfig("conf/logging.conf") |
227 | +LOGGER = logging.getLogger("deploy") |
228 | + |
229 | +class CmdError(Exception): |
230 | + """ |
231 | + Error when the execution of shell command failed. |
232 | + """ |
233 | + |
234 | + def __init__(self, code, message, cmd): |
235 | + Exception.__init__(self) |
236 | + self.code = code |
237 | + self.message = message |
238 | + self.cmd = cmd |
239 | + |
240 | +class ServiceFailedError(Exception): |
241 | + """ |
242 | + Error when servcie cannot be started. |
243 | + """ |
244 | + |
245 | + def __init__(self, service): |
246 | + Exception.__init__(self) |
247 | + self.service = service |
248 | + |
249 | +def pretty_print(msg, is_ended = False): |
250 | + """ |
251 | + Print msg in pretty format. |
252 | + |
253 | + Keyword arguments: |
254 | + msg -- the message to be printed |
255 | + is_ended -- whether it is the end part of the block or not (default False) |
256 | + |
257 | + """ |
258 | + |
259 | + LOGGER.info("---------------------------------------------------") |
260 | + LOGGER.info(" %s" % msg) |
261 | + LOGGER.info("---------------------------------------------------") |
262 | + if is_ended: |
263 | + LOGGER.info("") |
264 | + LOGGER.info("") |
265 | + LOGGER.info("") |
266 | + |
267 | +def print_file(path): |
268 | + """ |
269 | + Print the content of the file specified by path. |
270 | + |
271 | + Keyword arguments: |
272 | + path -- the path of the file to be printed. |
273 | + |
274 | + """ |
275 | + |
276 | + LOGGER.info("*****The content of file '%s' is from here:*****" % path) |
277 | + |
278 | + with open(path, "r") as lines: |
279 | + for line in lines: |
280 | + LOGGER.info(line.rstrip()) |
281 | + |
282 | + LOGGER.info("*****The content of file '%s' is to here. *****" % path) |
283 | + LOGGER.info("") |
284 | + LOGGER.info("") |
285 | + |
286 | +def exec_cmd(cmd): |
287 | + """ |
288 | + Execute the command. |
289 | + |
290 | + Keyword arguments: |
291 | + cmd -- the command to be executed. |
292 | + |
293 | + """ |
294 | + |
295 | + LOGGER.info("Execute shell command: %s" % cmd) |
296 | + LOGGER.debug("*****The output of the shell command is from here:*****") |
297 | + result = commands.getstatusoutput(cmd) |
298 | + for line in result[1].split("\n"): |
299 | + LOGGER.debug(line) |
300 | + LOGGER.debug("*****The output of the shell command is to here. *****") |
301 | + LOGGER.info("") |
302 | + LOGGER.info("") |
303 | + |
304 | + #When running puppetd, there was no error in messages, |
305 | + #but status 512 was returned, so I add the condition |
306 | + #(cmd.find("puppetd") != -1 and result[0] == 512) |
307 | + if result[0] != 0 and not (cmd.find("puppetd") != -1 and result[0] == 512): |
308 | + raise CmdError(result[0], result[1], cmd) |
309 | + |
310 | + return result |
311 | + |
312 | +def exec_cmd_with_sudo(cmd): |
313 | + """ |
314 | + Execute command as root. |
315 | + |
316 | + Keyword arguments: |
317 | + cmd -- the command to be executed |
318 | + |
319 | + """ |
320 | + |
321 | + return exec_cmd("sudo " + cmd) |
322 | + |
323 | +def exec_ssh_cmd(target, cmd, user = "root"): |
324 | + """ |
325 | + Execute remote command with ssh. |
326 | + |
327 | + Keyword arguments: |
328 | + target -- the target computer where the command will be executed |
329 | + cmd -- the command to be executed |
330 | + user -- the user to execute command (default: root) |
331 | + |
332 | + """ |
333 | + |
334 | + return exec_cmd("%s@%s 'sudo -u %s sh -c \"%s\"'" |
335 | + % (CONF["ssh_cmd_prefix"], target, user, cmd)) |
336 | + |
337 | +def copy_to_remote(target, src_path, dest_path): |
338 | + """ |
339 | + Copy files to remote computer. |
340 | + |
341 | + Keyword arguments: |
342 | + target -- the remote computer to which files will be copied. |
343 | + src_path -- the local path of the files to be copied. |
344 | + dest_path -- the remote path whick the files will be copied to. |
345 | + |
346 | + """ |
347 | + |
348 | + tmp_folder = str(int(time.time() * 1000)) |
349 | + |
350 | + #Check if the dest_path exists |
351 | + try: |
352 | + exec_ssh_cmd(target, "ls %s > /dev/null" % dest_path) |
353 | + except CmdError: |
354 | + exec_ssh_cmd(target, "mkdir -p %s" % dest_path) |
355 | + |
356 | + exec_ssh_cmd(target, "mkdir /home/%s/%s" |
357 | + % (CONF["ssh_user"], tmp_folder), CONF["ssh_user"]) |
358 | + exec_cmd("scp -r %s %s@%s:~/%s/" |
359 | + % (src_path, CONF["ssh_user"], target, tmp_folder)) |
360 | + exec_ssh_cmd(target, "cp -rp /home/%s/%s/* %s" |
361 | + % (CONF["ssh_user"], tmp_folder, dest_path)) |
362 | + exec_ssh_cmd(target, "rm -rf /home/%s/%s" |
363 | + % (CONF["ssh_user"], tmp_folder)) |
364 | + |
365 | +def append_to_remote_file(target, src_file_path, dest_file_path): |
366 | + """ |
367 | + Append a file contents to the remote file. |
368 | + |
369 | + Keyword arguments: |
370 | + target -- the remote computer in which the destination file will be. |
371 | + src_file_path -- the file contents will be copied. |
372 | + dest_file_path -- the remote file will be appended to. |
373 | + """ |
374 | + |
375 | + tmp_folder = str(int(time.time() * 1000)) |
376 | + exec_ssh_cmd(target, "mkdir /home/%s/%s" |
377 | + % (CONF["ssh_user"], tmp_folder), CONF["ssh_user"]) |
378 | + exec_cmd("scp -r %s %s@%s:~/%s/" |
379 | + % (src_file_path, CONF["ssh_user"], target, tmp_folder)) |
380 | + exec_ssh_cmd(target, "cat ~/%s/* >> %s" % (tmp_folder, dest_file_path)) |
381 | + exec_ssh_cmd(target, "rm -rf /home/%s/%s" |
382 | + % (CONF["ssh_user"], tmp_folder)) |
383 | + |
384 | + |
385 | +def load_conf(path): |
386 | + """ |
387 | + Load configuration from the file specified by path. |
388 | + |
389 | + Keyword arguments: |
390 | + path -- the path of the file where configuration will be loaded from |
391 | + |
392 | + """ |
393 | + |
394 | + pretty_print("Loading configuration begins") |
395 | + |
396 | + LOGGER.info("Load configuration from file %s" % path) |
397 | + |
398 | + print_file(path) |
399 | + |
400 | + with open(path, "r") as lines: |
401 | + for line in lines: |
402 | + line = line.strip() |
403 | + if line == "": |
404 | + continue |
405 | + |
406 | + pair = line.split("=") |
407 | + CONF[pair[0].rstrip()] = pair[1].lstrip() |
408 | + |
409 | + pretty_print("Loading configuration ends", True) |
410 | + |
411 | +def install_puppet_server(): |
412 | + """ |
413 | + Install puppet server. |
414 | + """ |
415 | + |
416 | + pretty_print("Installing puppet server begins") |
417 | + |
418 | + target = CONF["puppet_server"] |
419 | + copy_to_remote(target, "%s/conf/puppet-server/*" % TOOL_HOME, |
420 | + "/etc/puppet/") |
421 | + copy_to_remote(target, "%s/conf/etc-default/puppetmaster" % TOOL_HOME, |
422 | + "/etc/default/") |
423 | + |
424 | + exec_ssh_cmd(target, "apt-get -y --force-yes install puppetmaster") |
425 | + |
426 | + copy_to_remote(target, "%s/manifests/*" % TOOL_HOME, |
427 | + "/etc/puppet/manifests") |
428 | + copy_to_remote(target, "%s/files/*" % TOOL_HOME, "/etc/puppet/files/") |
429 | + copy_to_remote(target, "%s/templates/*" % TOOL_HOME, |
430 | + "/etc/puppet/templates/") |
431 | + copy_to_remote(target, "%s/conf/deploy.conf" % TOOL_HOME, |
432 | + "/etc/puppet/files") |
433 | + append_to_remote_file(target, "%s/conf/flags.conf" % TOOL_HOME, |
434 | + "/etc/puppet/templates/nova.conf.erb") |
435 | + |
436 | + exec_ssh_cmd(target, "service puppetmaster restart") |
437 | + |
438 | + pretty_print("Installing puppet server ends", True) |
439 | + |
440 | +def install_puppet_client(): |
441 | + """ |
442 | + Install puppet client. |
443 | + """ |
444 | + |
445 | + pretty_print("Installing puppet client begins") |
446 | + |
447 | + targets = [] |
448 | + for component in COMPONENTS: |
449 | + targets += CONF[component].split(",") |
450 | + |
451 | + for target in set(targets): |
452 | + exec_ssh_cmd(target, "apt-get -y --force-yes install puppet") |
453 | + |
454 | + pretty_print("Installing puppet client ends", True) |
455 | + |
456 | +def exec_puppet_client(): |
457 | + """ |
458 | + Execute puppet client on each servers to install nova components. |
459 | + """ |
460 | + |
461 | + pretty_print("Executing puppetclient begins.") |
462 | + |
463 | + targets = [] |
464 | + for component in COMPONENTS: |
465 | + targets += CONF[component].split(",") |
466 | + |
467 | + for target in set(targets): |
468 | + try: |
469 | + exec_ssh_cmd(target, |
470 | + "puppetd --verbose --test --server %s" |
471 | + % CONF["puppet_server"]) |
472 | + except CmdError: |
473 | + pass |
474 | + |
475 | + for component in COMPONENTS: |
476 | + targets = CONF[component].split(",") |
477 | + service = component.replace("_", "-") |
478 | + for target in targets: |
479 | + if component == "euca2ools": |
480 | + continue |
481 | + |
482 | + try: |
483 | + exec_ssh_cmd(target, "service %s restart; sleep 1" |
484 | + % service) |
485 | + except CmdError: |
486 | + pass |
487 | + |
488 | + copy_to_remote(CONF["mysql"], TOOL_HOME + "/setup-network.sh", "/tmp/") |
489 | + |
490 | + try: |
491 | + exec_ssh_cmd(CONF["mysql"], "/tmp/setup-network.sh 2>&1") |
492 | + except CmdError: |
493 | + pass |
494 | + |
495 | + pretty_print("Executing puppetclient ends.", True) |
496 | + |
497 | +def wait_until_services_started(): |
498 | + """ |
499 | + Wait until all the service started. |
500 | + """ |
501 | + |
502 | + pretty_print("Waiting until all services are started begins.") |
503 | + |
504 | + for component in COMPONENTS: |
505 | + if component == "euca2ools": |
506 | + continue |
507 | + |
508 | + targets = CONF[component].split(",") |
509 | + service = component.replace("_", "-") |
510 | + for target in targets: |
511 | + result = exec_ssh_cmd(target, "service %s status" % service) |
512 | + while result[1].find("failed") == -1 and \ |
513 | + result[1].find("running") == -1: |
514 | + |
515 | + time.sleep(10) |
516 | + result = exec_ssh_cmd(target, "service %s status" % service) |
517 | + |
518 | + if result[1].find("failed") != -1: |
519 | + raise ServiceFailedError(service) |
520 | + |
521 | + pretty_print("Waiting until all services are started ends.", True) |
522 | + |
523 | +def do_test(): |
524 | + """ |
525 | + Do test. |
526 | + """ |
527 | + |
528 | + pretty_print("Test begins.") |
529 | + |
530 | + target = CONF["euca2ools"] |
531 | + copy_to_remote(target, TOOL_HOME + "/test.sh", "/tmp/") |
532 | + copy_to_remote(target, TOOL_HOME + "/images.tgz", "/tmp/") |
533 | + exec_ssh_cmd(target, "/tmp/test.sh 2>&1") |
534 | + |
535 | + pretty_print("Test ends.", True) |
536 | + |
537 | +def main(): |
538 | + """ |
539 | + Main function. |
540 | + """ |
541 | + |
542 | + load_conf("conf/deploy.conf") |
543 | + CONF["ssh_cmd_prefix"] = ("ssh -o StrictHostKeyChecking=no -t " |
544 | + + CONF["ssh_user"]) |
545 | + |
546 | + try: |
547 | + install_puppet_server() |
548 | + install_puppet_client() |
549 | + exec_puppet_client() |
550 | + wait_until_services_started() |
551 | + do_test() |
552 | + except CmdError as cmd_error: |
553 | + LOGGER.error("Error occured when executing the shell command: " |
554 | + + cmd_error.cmd) |
555 | + LOGGER.error("Error code: " + str(cmd_error.code)) |
556 | + except ServiceFailedError as service_failed_error: |
557 | + LOGGER.error("Error occured when staring the service(%s)." |
558 | + % service_failed_error.service) |
559 | + except: |
560 | + LOGGER.error("Unexpected error:" + str(sys.exc_info()[0])) |
561 | + traceback.print_exc(file=sys.stdout) |
562 | + |
563 | +if __name__ == '__main__': |
564 | + main() |
565 | |
566 | === added directory 'contrib/nova-deployment-tool2011/files' |
567 | === added file 'contrib/nova-deployment-tool2011/files/external_nodes.py' |
568 | --- contrib/nova-deployment-tool2011/files/external_nodes.py 1970-01-01 00:00:00 +0000 |
569 | +++ contrib/nova-deployment-tool2011/files/external_nodes.py 2011-01-06 09:41:56 +0000 |
570 | @@ -0,0 +1,44 @@ |
571 | +#!/usr/bin/python |
572 | + |
573 | +import os |
574 | +import sys |
575 | +import re |
576 | +import time |
577 | +import yaml |
578 | + |
579 | +hostname = sys.argv[1] |
580 | + |
581 | +os.chdir(os.path.abspath(os.path.dirname(__file__))) |
582 | + |
583 | +parameters = {} |
584 | +classes = [] |
585 | +with open("deploy.conf", "r") as lines: |
586 | + for line in lines: |
587 | + line = line.strip() |
588 | + if line == "": |
589 | + continue |
590 | + |
591 | + pair = line.split("=") |
592 | + component = pair[0].strip() |
593 | + hostnames = pair[1].strip().split(",") |
594 | + if component == "puppet_server": |
595 | + parameters["puppet_server"] = hostnames[0] |
596 | + continue |
597 | + |
598 | + if component == "mysql": |
599 | + parameters["mysql_addr"] = hostnames[0] |
600 | + |
601 | + if component == "nova_api": |
602 | + parameters["cc_addr"] = hostnames[0] |
603 | + |
604 | + if component == "nova_objectstore": |
605 | + parameters["s3_addr"] = hostnames[0] |
606 | + |
607 | + if hostname in hostnames: |
608 | + classes.append(component) |
609 | + |
610 | +yamldoc = {"classes": classes, "parameters": parameters} |
611 | +print yaml.dump(yamldoc, explicit_start=True, |
612 | + default_flow_style=False) |
613 | + |
614 | +exit(0) |
615 | |
616 | === added file 'contrib/nova-deployment-tool2011/files/mysql-init.sh' |
617 | --- contrib/nova-deployment-tool2011/files/mysql-init.sh 1970-01-01 00:00:00 +0000 |
618 | +++ contrib/nova-deployment-tool2011/files/mysql-init.sh 2011-01-06 09:41:56 +0000 |
619 | @@ -0,0 +1,14 @@ |
620 | +#!/bin/bash |
621 | + |
622 | +# |
623 | +# Copyright (c) National Institute of Informatics 2010 All rights reserved. |
624 | +# |
625 | + |
626 | +sudo sed -i "s/127.0.0.1/0.0.0.0/g" /etc/mysql/my.cnf |
627 | + |
628 | +mysql -uroot -pnova -e "CREATE DATABASE nova;" |
629 | +mysql -uroot -pnova -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;" |
630 | +mysql -uroot -pnova -e "SET PASSWORD FOR 'root'@'%' = PASSWORD('nova');" |
631 | + |
632 | +#sudo nova-manage network create 10.0.0.0/8 3 16 |
633 | +#mysql -uroot -pnova -e "UPDATE networks SET BRIDGE = 'br100'" nova |
634 | |
635 | === added file 'contrib/nova-deployment-tool2011/files/mysql-preseed.sh' |
636 | --- contrib/nova-deployment-tool2011/files/mysql-preseed.sh 1970-01-01 00:00:00 +0000 |
637 | +++ contrib/nova-deployment-tool2011/files/mysql-preseed.sh 2011-01-06 09:41:56 +0000 |
638 | @@ -0,0 +1,13 @@ |
639 | +#!/bin/bash |
640 | + |
641 | +# |
642 | +# Copyright (c) National Institute of Informatics 2010 All rights reserved. |
643 | +# |
644 | + |
645 | +MYSQL_PASS="nova" |
646 | + |
647 | +cat <<MYSQL_PRESEED | debconf-set-selections |
648 | +mysql-server-5.1 mysql-server/root_password password $MYSQL_PASS |
649 | +mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS |
650 | +mysql-server-5.1 mysql-server/start_on_boot boolean true |
651 | +MYSQL_PRESEED |
652 | |
653 | === added directory 'contrib/nova-deployment-tool2011/log' |
654 | === added directory 'contrib/nova-deployment-tool2011/manifests' |
655 | === added file 'contrib/nova-deployment-tool2011/manifests/site.pp' |
656 | --- contrib/nova-deployment-tool2011/manifests/site.pp 1970-01-01 00:00:00 +0000 |
657 | +++ contrib/nova-deployment-tool2011/manifests/site.pp 2011-01-06 09:41:56 +0000 |
658 | @@ -0,0 +1,114 @@ |
659 | +/* |
660 | + * Copyright (c) National Institute of Informatics 2010 All rights reserved. |
661 | + * |
662 | + */ |
663 | + |
664 | +$work_dir = "/tmp" |
665 | +$nova_conf_tpl = "nova.conf.erb" |
666 | + |
667 | +Exec { |
668 | + path => "/usr/bin:/bin:/usr/sbin:/sbin:$work_dir", |
669 | + cwd => "$work_dir" |
670 | +} |
671 | + |
672 | +File { |
673 | + owner => root, |
674 | + group => root, |
675 | + mode => 777 |
676 | +} |
677 | + |
678 | +define nova_component() { |
679 | + package { |
680 | + "$title": |
681 | + ensure => present, |
682 | + require => Package["python-nova"] |
683 | + } |
684 | +} |
685 | + |
686 | +package { |
687 | + "python-mysqldb": |
688 | + ensure => present; |
689 | + "python-nova": |
690 | + ensure => present; |
691 | + "nova-common": |
692 | + ensure => present; |
693 | +} |
694 | + |
695 | +file { |
696 | + "/etc/nova/nova.conf": |
697 | + content => template("/etc/puppet/templates/$nova_conf_tpl"), |
698 | + mode => 666; |
699 | +} |
700 | + |
701 | +class nova_api { |
702 | + nova_component { |
703 | + ["rabbitmq-server", "nova-api", "python-libvirt"]: |
704 | + } |
705 | +} |
706 | + |
707 | +class nova_objectstore { |
708 | + nova_component { |
709 | + "nova-objectstore": |
710 | + } |
711 | +} |
712 | + |
713 | +class nova_volume { |
714 | + nova_component { |
715 | + "nova-volume": |
716 | + } |
717 | +} |
718 | + |
719 | +class nova_compute { |
720 | + nova_component { |
721 | + "nova-compute": |
722 | + } |
723 | +} |
724 | + |
725 | +class nova_scheduler { |
726 | + nova_component { |
727 | + "nova-scheduler": |
728 | + } |
729 | +} |
730 | + |
731 | +class nova_network { |
732 | + nova_component { |
733 | + "nova-network": |
734 | + } |
735 | +} |
736 | + |
737 | +class mysql { |
738 | + file { |
739 | + "$work_dir/mysql-preseed.sh": |
740 | + alias => "mysql-preseed.sh", |
741 | + source => "puppet://$puppet_server/files/mysql-preseed.sh"; |
742 | + "$work_dir/mysql-init.sh": |
743 | + alias => "mysql-init.sh", |
744 | + source => "puppet://$puppet_server/files/mysql-init.sh"; |
745 | + } |
746 | + exec { |
747 | + "mysql-preseed.sh > mysql-preseed.log 2>&1": |
748 | + alias => "mysql-preseed.sh", |
749 | + require => File["mysql-preseed.sh"]; |
750 | + "mysql-init.sh > mysql-init.log 2>&1": |
751 | + alias => "mysql-init.sh", |
752 | + require => [Package["mysql-server", "nova-common"], File["mysql-init.sh"], Service["mysql"]], |
753 | + } |
754 | + package { |
755 | + "mysql-server": |
756 | + ensure => present, |
757 | + require => Exec["mysql-preseed.sh"], |
758 | + notify => Service["mysql"] |
759 | + } |
760 | + service { |
761 | + "mysql": |
762 | + ensure => running |
763 | + } |
764 | +} |
765 | + |
766 | +class euca2ools { |
767 | + package { |
768 | + ["euca2ools", "unzip"]: |
769 | + ensure => present |
770 | + } |
771 | +} |
772 | + |
773 | |
774 | === added file 'contrib/nova-deployment-tool2011/setup-network.sh' |
775 | --- contrib/nova-deployment-tool2011/setup-network.sh 1970-01-01 00:00:00 +0000 |
776 | +++ contrib/nova-deployment-tool2011/setup-network.sh 2011-01-06 09:41:56 +0000 |
777 | @@ -0,0 +1,8 @@ |
778 | +#!/bin/bash |
779 | + |
780 | +# |
781 | +# Copyright (c) National Institute of Informatics 2010 All rights reserved. |
782 | +# |
783 | + |
784 | +sudo nova-manage network create 10.0.0.0/8 3 16 |
785 | +mysql -uroot -pnova -e "UPDATE networks SET BRIDGE = 'br100'" nova |
786 | |
787 | === added directory 'contrib/nova-deployment-tool2011/templates' |
788 | === added file 'contrib/nova-deployment-tool2011/templates/nova.conf.erb' |
789 | --- contrib/nova-deployment-tool2011/templates/nova.conf.erb 1970-01-01 00:00:00 +0000 |
790 | +++ contrib/nova-deployment-tool2011/templates/nova.conf.erb 2011-01-06 09:41:56 +0000 |
791 | @@ -0,0 +1,32 @@ |
792 | +--sql_connection=mysql://root:nova@<%= mysql_addr %>/nova |
793 | +--s3_host=<%= s3_addr %> |
794 | +--rabbit_host=<%= cc_addr %> |
795 | +--cc_host=<%= cc_addr %> |
796 | +--ec2_url=http://<%= cc_addr %>:8773/services/Cloud |
797 | +--network_manager=nova.network.manager.FlatManager |
798 | + |
799 | +--daemonize=1 |
800 | + |
801 | +--dhcpbridge_flagfile=/etc/nova/nova.conf |
802 | +--dhcpbridge=/usr/bin/nova-dhcpbridge |
803 | + |
804 | +--FAKE_subdomain=ec2 |
805 | + |
806 | +--ca_path=/var/lib/nova/CA |
807 | +--keys_path=/var/lib/nova/keys |
808 | +--networks_path=/var/lib/nova/networks |
809 | +--instances_path=/var/lib/nova/instances |
810 | +--images_path=/var/lib/nova/images |
811 | +--buckets_path=/var/lib/nova/buckets |
812 | + |
813 | + |
814 | +--injected_network_template=/usr/share/nova/interfaces.template |
815 | +--libvirt_rescue_uml_xml_template=/usr/share/nova/libvirt.rescue.uml.xml.template |
816 | +--libvirt_rescue_xml_template=/usr/share/nova/libvirt.rescue.qemu.xml.template |
817 | +--libvirt_uml_xml_template=/usr/share/nova/libvirt.uml.xml.template |
818 | +--libvirt_xml_template=/usr/share/nova/libvirt.qemu.xml.template |
819 | +--vpn_client_template=/usr/share/nova/client.ovpn.template |
820 | +--credentials_template=/usr/share/nova/novarc.template |
821 | + |
822 | +--logdir=/var/log/nova |
823 | +--verbose |
824 | |
825 | === added file 'contrib/nova-deployment-tool2011/test.sh' |
826 | --- contrib/nova-deployment-tool2011/test.sh 1970-01-01 00:00:00 +0000 |
827 | +++ contrib/nova-deployment-tool2011/test.sh 2011-01-06 09:41:56 +0000 |
828 | @@ -0,0 +1,43 @@ |
829 | +#!/usr/bin/env bash |
830 | + |
831 | +# |
832 | +# Copyright (c) National Institute of Informatics 2010 All rights reserved. |
833 | +# |
834 | + |
835 | +apt-get -y install gawk |
836 | + |
837 | +cd /tmp/ |
838 | + |
839 | +tar xvzf images.tgz |
840 | + |
841 | +sudo nova-manage user admin anne |
842 | +sudo nova-manage project create IRT anne |
843 | + |
844 | +rm nova.zip |
845 | +sudo nova-manage project zipfile IRT anne |
846 | + |
847 | +rm -rf env |
848 | +unzip -d env/ nova.zip |
849 | +. env/novarc |
850 | + |
851 | +euca-bundle-image -i images/aki-lucid/image -p kernel --kernel true |
852 | +euca-bundle-image -i images/ari-lucid/image -p ramdisk --ramdisk true |
853 | +euca-upload-bundle -m /tmp/kernel.manifest.xml -b mybucket |
854 | +euca-upload-bundle -m /tmp/ramdisk.manifest.xml -b mybucket |
855 | +kernel=`euca-register mybucket/kernel.manifest.xml | gawk '{print $2}'` |
856 | +echo "kernel: [$kernel]" |
857 | +ramdisk=`euca-register mybucket/ramdisk.manifest.xml | gawk '{print $2}'` |
858 | +echo "ramdisk: [$ramdisk]" |
859 | + |
860 | +euca-bundle-image -i images/ami-tiny/image -p machine --kernel $kernel --ramdisk $ramdisk |
861 | +euca-upload-bundle -m /tmp/machine.manifest.xml -b mybucket |
862 | +image=`euca-register mybucket/machine.manifest.xml | gawk '{print $2}'` |
863 | +echo "image: [$image]" |
864 | + |
865 | +euca-add-keypair mykey > mykey.priv |
866 | +chmod 400 mykey.priv |
867 | + |
868 | +#Wait for image processing for a while. Sometimes there will be error while executing command, |
869 | +#such as "mkdir -p ..." and "resize2fs ..." |
870 | +sleep 10 |
871 | +euca-run-instances $image --kernel $kernel --ramdisk $ramdisk -k mykey |
872 | |
873 | === added file 'contrib/nova-deployment-tool2011/uninstall.sh' |
874 | --- contrib/nova-deployment-tool2011/uninstall.sh 1970-01-01 00:00:00 +0000 |
875 | +++ contrib/nova-deployment-tool2011/uninstall.sh 2011-01-06 09:41:56 +0000 |
876 | @@ -0,0 +1,23 @@ |
877 | +#!/bin/bash |
878 | + |
879 | +sudo apt-get -y remove puppet puppetmaster |
880 | + |
881 | +sudo apt-get -y remove nova-common nova-doc python-nova nova-api nova-network nova-volume nova-objectstore nova-scheduler |
882 | + |
883 | +sudo service mysql stop |
884 | +sudo apt-get -y remove rabbitmq-server mysql-server |
885 | +#sudo rm /var/log/nova/nova-* |
886 | + |
887 | +#sudo apt-get -y autoremove |
888 | + |
889 | +sudo rm -rf /etc/puppet |
890 | +sudo rm -rf /var/lib/puppet |
891 | +sudo rm -rf /var/log/puppet |
892 | +sudo rm -rf /var/run/puppet |
893 | +sudo rm -rf /var/cache/apt/archives/puppet* |
894 | +sudo rm -rf /var/lib/update-rc.d/puppet* |
895 | +sudo rm -rf /etc/logrotate.d/puppet |
896 | +sudo rm -rf /etc/logcheck/ignore.d.server/puppet* |
897 | + |
898 | + |
899 | +sudo rm -rf /etc/default/puppet* |
The files that have a copyright header probably also need the standard apache license header used throughout the project.