Added the option to use Ceph for Nova ephemeral.

Changed the live_migration_flags to Ceph reccomended if being used
Hardcoded Nova to talk to Cinder internalURL
Added option for setting Nova-console keymap

Change-Id: If0d3104c1ad5a76315a72f7fc7d7b79b9e87ae52
diff --git a/README.rst b/README.rst
index ab8c03a..d415871 100644
--- a/README.rst
+++ b/README.rst
@@ -157,7 +157,6 @@
           max_files: 4096
           max_processes: 4096
 
-
 Nova services on compute node with OpenContrail
 
 .. code-block:: yaml
@@ -204,6 +203,22 @@
          virtual_host: '/openstack'
       ....
 
+
+Nova with ephemeral configured with Ceph
+
+.. code-block:: yaml
+
+    nova:
+      compute:
+        enabled: true
+        ...
+        ceph:
+          ephemeral: yes
+          rbd_pool: nova
+          rbd_user: nova
+          secret_uuid: 03006edd-d957-40a3-ac4c-26cd254b3731
+
+
 Documentation and Bugs
 ============================
 
@@ -228,4 +243,4 @@
 
 Developers should also join the discussion on the IRC list, at:
 
-    https://wiki.openstack.org/wiki/Meetings/openstack-salt
\ No newline at end of file
+    https://wiki.openstack.org/wiki/Meetings/openstack-salt
diff --git a/nova/files/juno/nova-compute.conf.Debian b/nova/files/juno/nova-compute.conf.Debian
index 08e5e10..ebb3c5a 100644
--- a/nova/files/juno/nova-compute.conf.Debian
+++ b/nova/files/juno/nova-compute.conf.Debian
@@ -22,7 +22,11 @@
 reserved_host_memory_mb = {{ compute.reserved_host_memory_mb }}
 {%- endif %}
 
+{%- if compute.ceph.ephemeral is defined %}
+live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
+{%- else %}
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE
+{%- endif %}
 live_migration_retry_count=30
 
 #Neutron
@@ -127,3 +131,18 @@
 auth_port = {{ compute.identity.port }}
 auth_protocol=http
 auth_uri=http://{{ compute.identity.host }}:5000
+
+{%- if compute.ceph.ephemeral is defined %}
+[libvirt]
+images_type=rbd
+images_rbd_pool={{ compute.ceph.rbd_pool }}
+images_rbd_ceph_conf=/etc/ceph/ceph.conf
+rbd_user={{ compute.ceph.rbd_user }}
+rbd_secret_uuid={{ compute.ceph.secret_uuid }}
+libvirt_inject_password=false
+libvirt_inject_key=false
+libvirt_inject_partition=-2
+{%- endif %}
+
+[cinder]
+catalog_info=volumev2:cinderv2:internalURL
diff --git a/nova/files/juno/nova-controller.conf.Debian b/nova/files/juno/nova-controller.conf.Debian
index d861cfc..8e8d138 100644
--- a/nova/files/juno/nova-controller.conf.Debian
+++ b/nova/files/juno/nova-controller.conf.Debian
@@ -151,3 +151,6 @@
 connection_debug = 10
 pool_timeout = 120
 connection = {{ controller.database.engine }}://{{ controller.database.user }}:{{ controller.database.password }}@{{ controller.database.host }}/{{ controller.database.name }}
+
+[cinder]
+catalog_info=volumev2:cinderv2:internalURL
diff --git a/nova/files/kilo/nova-compute.conf.Debian b/nova/files/kilo/nova-compute.conf.Debian
index 9c4a352..0b42c74 100644
--- a/nova/files/kilo/nova-compute.conf.Debian
+++ b/nova/files/kilo/nova-compute.conf.Debian
@@ -16,6 +16,8 @@
 api_paste_config=/etc/nova/api-paste.ini
 volumes_path=/var/lib/nova/volumes
 enabled_apis=ec2,osapi_compute,metadata
+vnc_keymap = {{ compute.get('vnc_keymap', 'en-us') }}
+
 
 {%- if compute.image.use_cow is defined %}
 use_cow_images = {{ compute.image.use_cow }}
@@ -27,7 +29,11 @@
 
 allow_resize_to_same_host=True
 
+{%- if compute.ceph.ephemeral is defined %}
+live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
+{%- else %}
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE
+{%- endif %}
 live_migration_retry_count=30
 
 #Neutron
@@ -170,3 +176,16 @@
 
 [cinder]
 os_region_name = {{ compute.identity.region }}
+catalog_info=volumev2:cinderv2:internalURL
+
+{%- if compute.ceph.ephemeral is defined %}
+[libvirt]
+images_type=rbd
+images_rbd_pool={{ compute.ceph.rbd_pool }}
+images_rbd_ceph_conf=/etc/ceph/ceph.conf
+rbd_user={{ compute.ceph.rbd_user }}
+rbd_secret_uuid={{ compute.ceph.secret_uuid }}
+libvirt_inject_password=false
+libvirt_inject_key=false
+libvirt_inject_partition=-2
+{%- endif %}
diff --git a/nova/files/kilo/nova-controller.conf.Debian b/nova/files/kilo/nova-controller.conf.Debian
index fe39363..e61da50 100644
--- a/nova/files/kilo/nova-controller.conf.Debian
+++ b/nova/files/kilo/nova-controller.conf.Debian
@@ -24,6 +24,7 @@
 ram_allocation_ratio = {{ controller.ram_allocation_ratio }}
 disk_allocation_ratio = {{ controller.disk_allocation_ratio }}
 scheduler_default_filters = {{ controller.scheduler_default_filters }}
+vnc_keymap = {{ controller.get('vnc_keymap', 'en-us') }}
 
 allow_resize_to_same_host = True
 
@@ -208,3 +209,4 @@
 
 [cinder]
 os_region_name = {{ controller.identity.region }}
+catalog_info=volumev2:cinderv2:internalURL
diff --git a/nova/files/liberty/nova-compute.conf.Debian b/nova/files/liberty/nova-compute.conf.Debian
index 85ed88b..cf90e6f 100644
--- a/nova/files/liberty/nova-compute.conf.Debian
+++ b/nova/files/liberty/nova-compute.conf.Debian
@@ -27,7 +27,11 @@
 
 allow_resize_to_same_host=True
 
+{%- if compute.ceph.ephemeral is defined %}
+live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
+{%- else %}
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE
+{%- endif %}
 live_migration_retry_count=30
 
 #Neutron
@@ -170,3 +174,19 @@
 
 [cinder]
 os_region_name = {{ compute.identity.region }}
+catalog_info=volumev2:cinderv2:internalURL
+
+{%- if compute.ceph.ephemeral is defined %}
+[libvirt]
+images_type=rbd
+images_rbd_pool={{ compute.ceph.rbd_pool }}
+images_rbd_ceph_conf=/etc/ceph/ceph.conf
+rbd_user={{ compute.ceph.rbd_user }}
+rbd_secret_uuid={{ compute.ceph.secret_uuid }}
+libvirt_inject_password=false
+libvirt_inject_key=false
+libvirt_inject_partition=-2
+{%- endif %}
+
+[vnc]
+keymap = {{ compute.get('vnc_keymap', 'en-us') }}
diff --git a/nova/files/liberty/nova-controller.conf.Debian b/nova/files/liberty/nova-controller.conf.Debian
index d0b970b..864a778 100644
--- a/nova/files/liberty/nova-controller.conf.Debian
+++ b/nova/files/liberty/nova-controller.conf.Debian
@@ -207,3 +207,7 @@
 
 [cinder]
 os_region_name = {{ controller.identity.region }}
+catalog_info=volumev2:cinderv2:internalURL
+
+[vnc]
+keymap = {{ controller.get('vnc_keymap', 'en-us') }}
diff --git a/nova/files/mitaka/nova-compute.conf.Debian b/nova/files/mitaka/nova-compute.conf.Debian
index 547eba7..245daf4 100644
--- a/nova/files/mitaka/nova-compute.conf.Debian
+++ b/nova/files/mitaka/nova-compute.conf.Debian
@@ -26,7 +26,11 @@
 
 allow_resize_to_same_host=True
 
+{%- if compute.ceph.ephemeral is defined %}
+live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
+{%- else %}
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE
+{%- endif %}
 live_migration_retry_count=30
 
 auth_strategy = keystone
@@ -145,3 +149,19 @@
 
 [cinder]
 os_region_name = {{ compute.identity.region }}
+catalog_info=volumev2:cinderv2:internalURL
+
+{%- if compute.ceph.ephemeral is defined %}
+[libvirt]
+images_type=rbd
+images_rbd_pool={{ compute.ceph.rbd_pool }}
+images_rbd_ceph_conf=/etc/ceph/ceph.conf
+rbd_user={{ compute.ceph.rbd_user }}
+rbd_secret_uuid={{ compute.ceph.secret_uuid }}
+libvirt_inject_password=false
+libvirt_inject_key=false
+libvirt_inject_partition=-2
+{%- endif %}
+
+[vnc]
+keymap = {{ compute.get('vnc_keymap', 'en-us') }}
diff --git a/nova/files/mitaka/nova-controller.conf.Debian b/nova/files/mitaka/nova-controller.conf.Debian
index 3f48630..e38f50a 100644
--- a/nova/files/mitaka/nova-controller.conf.Debian
+++ b/nova/files/mitaka/nova-controller.conf.Debian
@@ -187,3 +187,7 @@
 
 [cinder]
 os_region_name = {{ controller.identity.region }}
+catalog_info=volumev2:cinderv2:internalURL
+
+[vnc]
+keymap = {{ controller.get('vnc_keymap', 'en-us') }}
diff --git a/tests/pillar/compute_cluster.sls b/tests/pillar/compute_cluster.sls
index bbfb87c..d4085e1 100644
--- a/tests/pillar/compute_cluster.sls
+++ b/tests/pillar/compute_cluster.sls
@@ -5,6 +5,7 @@
     virtualization: kvm
     heal_instance_info_cache_interval: 60
     vncproxy_url: openstack:6080
+    vnc_keymap: en-gb
     bind:
       vnc_address: 127.0.0.1
       vnc_port: 6080
diff --git a/tests/pillar/compute_single.sls b/tests/pillar/compute_single.sls
index fa22905..b7bb345 100644
--- a/tests/pillar/compute_single.sls
+++ b/tests/pillar/compute_single.sls
@@ -5,6 +5,7 @@
     virtualization: kvm
     heal_instance_info_cache_interval: 60
     vncproxy_url: openstack:6080
+    vnc_keymap: en-gb
     bind:
       vnc_address: 127.0.0.1
       vnc_port: 6080
diff --git a/tests/pillar/control_cluster.sls b/tests/pillar/control_cluster.sls
index 5ee0ab2..f680154 100644
--- a/tests/pillar/control_cluster.sls
+++ b/tests/pillar/control_cluster.sls
@@ -4,6 +4,7 @@
     networking: default
     version: liberty
     vncproxy_url: 127.0.0.1
+    vnc_keymap: en-gb
     security_group: false
     dhcp_domain: novalocal
     scheduler_default_filters: "DifferentHostFilter,RetryFilter,AvailabilityZoneFilter,RamFilter,CoreFilter,DiskFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter"
diff --git a/tests/pillar/control_single.sls b/tests/pillar/control_single.sls
index 8a06a7d..fb1bbf0 100644
--- a/tests/pillar/control_single.sls
+++ b/tests/pillar/control_single.sls
@@ -5,6 +5,7 @@
     version: liberty
     security_group: false
     vncproxy_url: 127.0.0.1
+    vnc_keymap: en-gb
     dhcp_domain: novalocal
     scheduler_default_filters: "DifferentHostFilter,RetryFilter,AvailabilityZoneFilter,RamFilter,CoreFilter,DiskFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter"
     cpu_allocation_ratio: 16.0