Cannot connect to systemvm using ssh when using CentOS 7 and ACP 4.7

Problem

Cannot connect to systemvm using ssh when using CENTOS 7 and ACP 4.7

Note: System VM private IP will be used for ssh only in case of Vmware ESXi.

Steps to Reproduce the problem

1. ssh from management server to private IP of systemvm. ( management server on centos 7.X and hypervisor as vmware)

2. The ssh fails with Permission denied (publickey).

Root Cause

The ssh fails since the system VM is not having the public key for the corresponding private key at management server.

In CloudPlatform, we mount our systemvm.iso to loop device node /dev/loop0 and copy relevant keys in it. Before mounting, loop device node(/dev/loop0) existence is checked( injectkeys.sh line 89: "if [ -e /dev/loop0 ]). But this check fails in CentOS 7, because CentOS 7(and later versions) creates loop device node according to demand. But other old versions of Unix-like OS gives 8 loop device nodes by default. E.g. "losetup –f" in CentOS7 lists the free devices or creates one loop device node and lists it, if non of the loop device node is free.

Required Modification

'losetup -f' is added in the script before checking the existence of the loop device.

Reason for Modification

 

Updating Cloudplatform script to handle the change in behaviour in CentOS 7.

Resolution/Workaround

A workaround would be to run the command 'losetup -f' and restart the management service

 

#losetup -f

#service cloudstack-management restart

Verification

ssh from management server to private IP of SystemVM. You should be able to establish the connecction.

 

Impact on Existing System

ssh from management server to private IP of systemVM will be successful.

 

Potential Adverse Effect

There is no known adverse effect to the system

Document ID:
115000139506

Product:
CloudPlatform

Version:
4.7

Reference Jira ID:
CS-50134

 
Have more questions? Submit a request

Comments