...
Hypervisor needs a sudo entry for user like:
...
cloudstack ALL=NOPASSWD: /usr/bin/cloudstack-setup-agent
defaults:cloudstack !requiretty
See discussion here.agent”
CloudStack agent install adds an /etc/profile.d file that allows lsmod to be seen in the path, as the management server checks for the kvm modules. This requires that the user have a default .bashrc which sources /etc/bashrc, otherwise the user will not be able to find lsmod with it's non-login "lsmod | grep kvm" remote command. Alternatively, the admin can make their own accommodations for the user ssh command to find lsmod.
...