hadfl / kvmadm

Manage KVM instances under SMF control (supports KVM in zones)
http://www.kvmadm.org
Other
21 stars 6 forks source link

unable to register kvm as a service #95

Closed gumpp closed 7 years ago

gumpp commented 7 years ago

I'm using OmniOS v11 r151014. After successful installation

./configure --prefix=/opt/kvmadm-0.11.0  --enable-svcinstall=/var/svc/manifest/site
gmake
gmake install

I did

svccfg import -v /var/svc/manifest/site/system-kvm.xml

which returned no errors.

However the service did not register correctly, i.e.

svcs -a | grep kvm

does not return any results.

hadfl commented 7 years ago

kvmadm won't install a default service. the manifest you imported is basically just a template. SMF instances will be created once kvm instances are added.

however you can check if the template was imported correctly: svccfg -s system/kvm listprop

gumpp commented 7 years ago

Thank you. Which procedure would recommend to make sure that the KVM zone is booted at system start? I was thinking about setting "autoboot" : "true" in conjunction with zoneadm -z zonename boot.

hadfl commented 7 years ago

"autoboot" : "true" should do the trick. nothing else needed. zoneadm -z <zonename> boot is to boot the zone manually, so not needed if the zone is autobooted

gumpp commented 7 years ago

OK, but wouldn't it be cool to start via svcadm? Something like: svcadm enable kvmadm

hadfl commented 7 years ago

the kvm instances are set-up as SMF instances so you can do that (actually that is exactly what kvmadm does if you call start/stop) let me give you an example for clarification:

  1. you setup a kvm instance in the GZ w/ the name kvmtest you can start/stop the kvm via svcadm enable system/kvm:kvmtest or via kvmadm start kvmtest the latter calls svcadm ...

  2. you setup a kvm instance in a NGZ w/ the name kvmzonetest kvmadm will setup a zone named kvmzonetest and an SMF instance named system/kvm:kvmzonetest within that zone you can start/stop the zone via zoneadm -z kvmzonetest boot or kvmadm start kvmzonetest the latter calls zoneadm ... the SMF instance in the zone is enabled by default. so no need to do svcadm -z kvmzonetest enable system/kvm:kvmzonetest. however you can still enable/disable the kvm SMF instance within the zone manually if you want

gumpp commented 7 years ago

Thank you very much for the explanations. Now, everything has become cristal clear. :+1: