Fix disk detection to work when used on a node with an alias

As the webui uses the alias in preference to the name, it will also pass
the alias as argument to the controller when fetching the list of disks.

So the controller should support finding a node by alias and by name.

Also, just be nice and don't crash if we don't find a node :-)

https://bugzilla.novell.com/show_bug.cgi?id=777897
(cherry picked from commit f77d608e3f89cf36e9ab3eaaedb2bf06637ec988)

Signed-off-by: Michal Jura <mjura@suse.com>
Was fixed
Calculate a reasonable default size of the local volume storage file

We use a quarter of the size of the disk for this. This works relatively
well for degenerate cases (small disks used in demo setups), and should
be good enough for normal cases.

Part of https://bugzilla.novell.com/show_bug.cgi?id=778250
(cherry picked from commit 4b71c3536ff99f6ab61f7fb727a7ebe5b08f2127)

Signed-off-by: Michal Jura <mjura@suse.com>

Conflicts:
	crowbar_framework/app/models/nova_service.rb
Improve list of storage disks in webui

We now:
  - display the size in GB, instead of sectors (!)
  - hide disks that are really small (< 0.1 GB)
  - sort the list of disks

Note that we use GB as in 1000, not GiB (as in 1024).
(cherry picked from commit 32fa5d1bc5e50eb1570d5b400d5e6c1913c61094)

Signed-off-by: Michal Jura <mjura@suse.com>

Conflicts:
	crowbar_framework/app/views/barclamp/nova/_edit_attributes.html.haml
nova-multi-controller role should not always conflict with ceph-store

The conflict is only valid if ceph is not used for volume storage.

https://bugzilla.novell.com/show_bug.cgi?id=777850
(cherry picked from commit a9394d51463e38e5cd903579908f3d764b217764)

Signed-off-by: Michal Jura <mjura@suse.com>
Add chef attribute for ram_allocation_ratio config option

The default value is "1.0", which essentially disables host RAM overcommit (bnc#784345)
See http://docs.openstack.org/essex/openstack-compute/admin/content/scheduler-filters.html#ramfilter
(cherry picked from commit 6cc2eeb78c62a091df9af46228649a56513e39c4)

Signed-off-by: Michal Jura <mjura@suse.com>
Fix javascript listing the volumes

Since 69346e11 in barclamp-crowbar, the text used when listing nodes for
each role is "<shortname> <fullname>" instead of "<shortname>". This
broke the javascript function using this text to query the list of disk
for the node.

So just remove everything after ' ' in the text when passing it as an
argument for the query.
(cherry picked from commit b45e63ba1d2b2ef273bfc025cb8d4796c5ed360b)

Signed-off-by: Michal Jura <mjura@suse.com>
Add three options to barclamp UI and handle them in chef too

We add support for the auto_assign_floating_ip option for nova-network,
and for cpu_allocation_ratio/ram_allocation_ratio options for
nova-scheduler (ram_allocation_ratio was already a chef attribute, but
with a value not changeable in the barclamp).

Signed-off-by: Vincent Untz <vuntz@suse.com>
(cherry picked from commit 03623e9fbbd656509480c1a36e322c5d8ffce595)

Signed-off-by: Michal Jura <mjura@suse.com>

Conflicts:
	chef/cookbooks/nova/attributes/default.rb
	crowbar.yml
	crowbar_framework/app/views/barclamp/nova/_edit_attributes.html.haml
default cpu_allocation_ratio to 16

this provides continuity with previous versions of SUSE Cloud 1.0
(cherry picked from commit 5eece7aa1bc5a0b57fcce166bc22820f660e0727)

Signed-off-by: Michal Jura <mjura@suse.com>

Conflicts:
	crowbar_framework/app/views/barclamp/nova/_edit_attributes.html.haml
Do not mark new options as required

This creates an issue for existing proposals, since the JSON data will
only have the new options if they get changed; most users trying to save
will face an error because of the schema.

Having them not required is okay since the cookbooks is using a sane
default for the values.
(cherry picked from commit e035f0bc1b5c74fc71ee88fd5635c935d5551c88)

Signed-off-by: Michal Jura <mjura@suse.com>