Revert
This commit is contained in:
parent
587a6138e0
commit
0034764697
9
README
9
README
|
@ -1,22 +1,21 @@
|
||||||
# Overview
|
# Overview
|
||||||
|
|
||||||
The nova-compute-power charm deploys OpenStack to a set IBM Power8 servers running PowerKVM.
|
The nova-compute-power charm deploys openstack to a given Power8 compute node.
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
To deploy a nova-compute-power service you have to have the following:
|
To deploy a nova-compute-power service you have to have the following:
|
||||||
|
|
||||||
* Generate a ssh key that the charm can use to login to the compute node
|
* Generate a ssh key that the charm can use to login to the compute node
|
||||||
to start installing RPMS and configuration file.
|
to start installing RPMS and configuration file
|
||||||
* A yum repository which contains the appropriate IBM Openstack Icehouse
|
* A yum repository which contains the appropriate IBM Openstack Icehouse
|
||||||
RPMs.
|
RPMs.
|
||||||
* sudo password-less configuration for the user on the compute node.
|
* Sudo password-less configured for the user on the compute node.
|
||||||
|
|
||||||
Once you have this setup you must configure the charm as follow:
|
Once you have this setup you must configure the charm as follow:
|
||||||
|
|
||||||
1. Place the key to the nova-compute node in the files directory of the
|
1. Place the key to the nova-compute node in the files directory of the
|
||||||
charm.
|
charm.
|
||||||
|
|
||||||
2. Create a config.yaml that has the following:
|
2. Create a config.yaml that has the following:
|
||||||
|
|
||||||
* power-user: username used to access and configure the power node.
|
* power-user: username used to access and configure the power node.
|
||||||
|
|
|
@ -7,6 +7,10 @@ options:
|
||||||
type: string
|
type: string
|
||||||
default:
|
default:
|
||||||
description: Username used to access POWER hypervisors.
|
description: Username used to access POWER hypervisors.
|
||||||
|
power-key:
|
||||||
|
type: string
|
||||||
|
default:
|
||||||
|
description: SSH key to use to accesss POWER hypervisors.
|
||||||
power-repo:
|
power-repo:
|
||||||
type: string
|
type: string
|
||||||
default:
|
default:
|
||||||
|
@ -14,7 +18,7 @@ options:
|
||||||
power-hosts:
|
power-hosts:
|
||||||
type: string
|
type: string
|
||||||
default:
|
default:
|
||||||
description: POWER hosts to manager; space delimited and must be IP addresses.
|
description: POWER hosts to manager; space delimited.
|
||||||
power-password:
|
power-password:
|
||||||
type: string
|
type: string
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -38,9 +38,8 @@ def add_bridge(bridge_name):
|
||||||
|
|
||||||
|
|
||||||
def add_bridge_port(bridge_name, port):
|
def add_bridge_port(bridge_name, port):
|
||||||
sudo('ovs-vsctl -- --may-exist '
|
sudo('ovs-vsctl -- --may-exist add-port %s %s' % (bridge_name,
|
||||||
'add-port %s %s' % (bridge_name,
|
port))
|
||||||
port))
|
|
||||||
sudo('ip link set %s up' % port)
|
sudo('ip link set %s up' % port)
|
||||||
sudo('ip link set %s promisc on' % port)
|
sudo('ip link set %s promisc on' % port)
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ from nova_compute_proxy import (
|
||||||
hooks = Hooks()
|
hooks = Hooks()
|
||||||
CONFIGS = register_configs()
|
CONFIGS = register_configs()
|
||||||
proxy = POWERProxy(user=config('power-user'),
|
proxy = POWERProxy(user=config('power-user'),
|
||||||
|
ssh_key=config('power-key'),
|
||||||
hosts=config('power-hosts'),
|
hosts=config('power-hosts'),
|
||||||
repository=config('power-repo'),
|
repository=config('power-repo'),
|
||||||
password=config('power-password'))
|
password=config('power-password'))
|
||||||
|
@ -35,7 +36,7 @@ proxy = POWERProxy(user=config('power-user'),
|
||||||
|
|
||||||
@hooks.hook()
|
@hooks.hook()
|
||||||
def install():
|
def install():
|
||||||
apt_install('fabric', fatal=True)
|
apt_install(['fabric'], fatal=True)
|
||||||
proxy.install()
|
proxy.install()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -56,24 +56,29 @@ CONFIG_FILES = [
|
||||||
|
|
||||||
class POWERProxy():
|
class POWERProxy():
|
||||||
|
|
||||||
def __init__(self, user, hosts,
|
def __init__(self, user, ssh_key, hosts,
|
||||||
repository, password):
|
repository, password):
|
||||||
if None in [user, hosts, repository]:
|
if None in [user, ssh_key, hosts, repository]:
|
||||||
raise ValueError('Missing configuration')
|
raise Exception('Missing configuration')
|
||||||
self.user = user
|
self.user = user
|
||||||
|
self.ssh_key = ssh_key
|
||||||
self.hosts = hosts.split()
|
self.hosts = hosts.split()
|
||||||
self.repository = repository
|
self.repository = repository
|
||||||
self.password = password
|
self.password = password
|
||||||
|
self.key_filename = self._write_key()
|
||||||
self._init_fabric()
|
self._init_fabric()
|
||||||
|
|
||||||
|
def _write_key(self):
|
||||||
|
return os.path.join(charm_dir(), 'files', self.ssh_key)
|
||||||
|
|
||||||
def _init_fabric(self):
|
def _init_fabric(self):
|
||||||
env.warn_only = True
|
env.warn_only = True
|
||||||
env.connection_attempts = 10
|
env.connection_attempts = 10
|
||||||
env.timeout = 10
|
env.timeout = 10
|
||||||
env.user = self.user
|
env.user = self.user
|
||||||
|
env.key_filename = self.key_filename
|
||||||
env.hosts = self.hosts
|
env.hosts = self.hosts
|
||||||
env.password = self.password
|
env.password = self.password
|
||||||
env.use_ssh_config = True
|
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
self._setup_yum()
|
self._setup_yum()
|
||||||
|
|
Loading…
Reference in New Issue