As a continuation of previous article introducing Cobbler inside VirtualBox, this one will talk about power management.
I suppose you already have Perl execution environment, then just follow the steps below:
- Download either from the original repository or from my cloned one;
cobbler syncor even
service cobbler restartand
service apache2 restart;
- Create a file named
vmname=$power_id vboxhost=$power_address login=$power_user action=$power_mode
- In Systems configuration of Cobbler Web UI, fill in following info:
10.0.2.2here shows that
NATis used and this IP points to your host;
- As this Perl script uses simple ssh login to interact with VBoxManage, it will prompt for
password, so you need to generate public key for
rootuser inside the virtual machine and put it to the user’s home of the host machine, which is
$HOME/.ssh/authorized_keys, and make sure to do an ssh login at least once to accept your host machine as a “known host”;
- Then run
cobbler system powerstatus --name=<name of the system>, you should be able to check the status.
BTW, I do think Cobbler does not respect
powerstatus checking should result return value as
2 as specified by the API spec,
but Cobbler keeps checking again and again and finally gets timeout, and if I put the return
0, it is then OK.
blog comments powered by Disqus