Instance ssh access
I'm building my small cmd wrapper around Cinder and Nova clients. I'm using Devstack to deploy OpenStack. I want to have ability to connect via ssh to an instance from a host machine using paramico
:
ip_addr = instance.addresses['private'][1]['addr'] # This network exists in 'private' section even I created it as public.
client = paramico.client.SSHClient()
client.load_system_host_keys()
client.connect(ip_addr)
I have added a floating ip to an instance before I tried to connect to the instance:
self.instance = self.nov_client.servers.create(
'inst1',
self.nov_client.images.find(
name='cirros-0.3.2-x86_64-uec-kernel'),
self.nov_client.flavors.find(name='m1.nano'))
self.f_ip = self.nov_client.floating_ips.create('public')
self.instance.add_floating_ip(self.f_ip)
What should I do to enable ssh access to an instance?
Add a rule to allow SSH in the security group