Shorten physical resource name to custom limit

The default limit for resources is 255, which is
determined by the column size of the name columns in
other openstack project databases.

The limit for nova servers is 53 characters due to typical default
linux HOST_NAME_MAX of 64, minus the '.novalocal' appended to the name.

The reduced name will consist of the following:
* the first 2 characters of the name
* a hyphen
* the end of the name, truncated on the left to bring
  the name length within the limit

The validation fix from bug: #1238272 has been removed.
Closes-Bug: #1250291

(cherry picked from commit 574f3ea54b1299f7f827bf0f6a88a83bccf9c3af)

Conflicts:
	heat/engine/resources/server.py

Change-Id: Iccaf905b2e73433a671559c49223c2b635402853
Using a number in str_replace causes an exception

When passing in a number as a parameter value to the string replace
function, an exception is raised. Cast the value as a string before
using it in the string replace function.

Change-Id: I38bdc8d97c7d1f9b62f52b0a783bf4d3fde3611a
Closes-Bug: #1250251