[OmniOS-discuss] Ang: Re: Ang: Re: Ang: Re: KVM and SMF

Johan Kragsterman johan.kragsterman at capvert.se
Thu Nov 6 12:03:36 UTC 2014


Thanks again, Jorge!

I tried that, but with no luck....

Like this:


root at omni:/mainpool/nfs/Backup/KVM# svcs -l pfsense
fmri         svc:/kvm/pfsense:default
name         KVM-pfsense
enabled      true
state        maintenance
next_state   none
state_time    6 november 2014 13:51:28 CET
logfile      /var/svc/log/kvm-pfsense:default.log
restarter    svc:/system/svc/restarter:default
dependency   require_all/none svc:/milestone/network:default (online)
dependency   require_all/none svc:/system/filesystem/local:default (online)
root at omni:/mainpool/nfs/Backup/KVM# svcs -vx
svc:/kvm/pfsense:default (KVM-pfsense)
 State: maintenance since  6 november 2014 13:51:28 CET
Reason: Start method failed repeatedly, last died on Killed (9).
   See: http://illumos.org/msg/SMF-8000-KS
   See: /var/svc/log/kvm-pfsense:default.log
Impact: This service is not running.
root at omni:/mainpool/nfs/Backup/KVM# 

Regards Johan


-----Jorge Schrauwen <sjorge+ml at blackdot.be> skrev: -----
Till: Johan Kragsterman <johan.kragsterman at capvert.se>
Från: Jorge Schrauwen <sjorge+ml at blackdot.be>
Datum: 2014-11-06 12:36
Kopia: omnios-discuss at lists.omniti.com
Ärende: Re: Ang: Re: Ang: Re: [OmniOS-discuss] KVM and SMF

Hi,

It could be you are using a wrong type of duration for your service.


     <property_group name='startd' type='framework'>
       <propval name='duration' type='astring' value='transient'/>
       <propval name='ignore_error' type='astring' value='core,signal'/>
     </property_group>

I use transient for my script that start qemu. By default if the process 
does not daemonize it is killed after... I think 90 seconds by default.

Regards

Jorge


On 2014-11-06 11:42, Johan Kragsterman wrote:
> Hi!
> 
> Trying to get the SMF service to work for my KVM VM's here....
> 
> I've succeeded to import the xml-file without any errors, but the
> service goes into maintenance mode after the startd have tried a
> couple of times.
> Looks like this:
> 
> 
> root at omni:/mainpool/nfs/Backup/KVM# svcs -p pfsense
> STATE          STIME    FMRI
> offline*       12:10:31 svc:/kvm/pfsense:default
>                12:10:31      711 vmpfsense.sh
>                12:10:31      715 qemu-system-x86
> 
> 
> root at omni:/mainpool/nfs/Backup/KVM# svcs -l pfsense
> fmri         svc:/kvm/pfsense:default
> name         KVM-pfsense
> enabled      true
> state        offline
> next_state   online
> state_time    6 november 2014 12:10:31 CET
> logfile      /var/svc/log/kvm-pfsense:default.log
> restarter    svc:/system/svc/restarter:default
> contract_id  90
> dependency   require_all/none svc:/milestone/network:default (online)
> dependency   require_all/none svc:/system/filesystem/local:default 
> (online)
> 
> 
> root at omni:/mainpool/nfs/Backup/KVM# svcs -l pfsense
> fmri         svc:/kvm/pfsense:default
> name         KVM-pfsense
> enabled      true
> state        maintenance
> next_state   none
> state_time    6 november 2014 12:12:31 CET
> logfile      /var/svc/log/kvm-pfsense:default.log
> restarter    svc:/system/svc/restarter:default
> contract_id
> dependency   require_all/none svc:/milestone/network:default (online)
> dependency   require_all/none svc:/system/filesystem/local:default 
> (online)
> root at omni:/mainpool/nfs/Backup/KVM#
> 
> 
> And like this:
> 
> 
> 
> root at omni:/mainpool/nfs/Backup/KVM# svcs -vx
> svc:/kvm/pfsense:default (KVM-pfsense)
>  State: maintenance since  6 november 2014 12:12:31 CET
> Reason: Start method died on Killed (9).
>    See: http://illumos.org/msg/SMF-8000-KS
>    See: /var/svc/log/kvm-pfsense:default.log
> Impact: This service is not running.
> root at omni:/mainpool/nfs/Backup/KVM#
> 
> 
> I got the log as well, but it is unneccesary long. The important thing 
> is here:
> 
> 
> 
> root at omni:/mainpool/nfs/Backup/KVM# tail $(svcs -L pfsense)
>   2: 00000000000f0000 - 0000000000100000 = 2
>   3: 0000000000100000 - 000000007fffd000 = 1
>   4: 000000007fffd000 - 0000000080000000 = 2
>   5: 00000000feffc000 - 00000000ff000000 = 2
>   6: 00000000fffc0000 - 0000000100000000 = 2
> enter handle_19:
>   NULL
> Booting from Hard Disk...
> Booting from 0000:7c00
> [ Nov  6 12:12:31 Method or service exit timed out.  Killing contract 
> 90. ]
> root at omni:/mainpool/nfs/Backup/KVM#
> 
> 
> 
> This is the only thing in the log that shows any errors: That the
> "Method or service exit timed out.  Killing contract 90"
> 
> 
> 
> 
> So I tried to increase the the "start timeout from 60 to 120 sec, but
> that made no difference"
> 
> I checked the reference to the illumos:
> http://illumos.org/msg/SMF-8000-KS , but that didn't give me any clue.
> 
> 
> So it actually starts the service, but then something times out...what
> is it that times out...?
> 
> 
> 
> 
> 
> 
> 
> My SMF xml file looks like this:
> 
> 
> 
> <?xml version='1.0'?>
> <!DOCTYPE service_bundle SYSTEM 
> '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
> <service_bundle type='manifest' name='export'>
> <service version='0' type='service' name='kvm/pfsense'>
> <create_default_instance enabled='true' />
> <single_instance />
> <dependency restart_on='none' grouping='require_all' type='service'
> name='network'>
> <service_fmri value='svc:/milestone/network:default' />
> </dependency>
> <dependency restart_on='none' grouping='require_all' type='service'
> name='filesystem'>
> <service_fmri value='svc:/system/filesystem/local:default' />
> </dependency>
> <exec_method type='method' exec='/usr/bin/vmpfsense.sh' name='start'
> timeout_seconds='120' />
> <exec_method type='method' exec=':kill' name='stop' 
> timeout_seconds='60' />
> <stability value='Unstable' />
> <template>
> <common_name>
> <loctext xml:lang='C'>KVM-pfsense</loctext>
> </common_name>
> </template>
> </service>
> </service_bundle>
> 
> 
> 
> I'd be happy if anyone with some more knowledge than I have could give
> me some clues...!
> 
> 
> Regards Johan
> 
> 
> 
> -----Jorge Schrauwen <sjorge+ml at blackdot.be> skrev: -----
> Till: Johan Kragsterman <johan.kragsterman at capvert.se>
> Från: Jorge Schrauwen <sjorge+ml at blackdot.be>
> Datum: 2014-11-05 21:27
> Ärende: Re: Ang: Re: [OmniOS-discuss] KVM and SMF
> 
> I don't know. But from experience svccfg will do what is needed to
> import it.
> 
> But I know for a fact service names <> paths. base on I have a few
> services that do not have a corresponding directory.
> 
> Regards
> 
> Jorge
> 
> 
> 
> On 2014-11-05 21:25, Johan Kragsterman wrote:
>> -----Jorge Schrauwen <jorge at blackdot.be> skrev: -----
>> Till: Johan Kragsterman <johan.kragsterman at capvert.se>
>> Från: Jorge Schrauwen <jorge at blackdot.be>
>> Datum: 2014-11-05 21:11
>> Ärende: Re: [OmniOS-discuss] KVM and SMF
>> 
>> You can import it using 'svccfg import mysmf.xml'.
>> 
>> ---
>> ~ sjorge
>> 
>> 
>> Hey, Jorge, I thought you were going to answer me...!
>> 
>> 
>> Yeah, I know how I import it, but what I asked about was the naming:
>> 
>>  If I call it: service name='kvm/pfsense', where does it go, when I
>> import it, since there is no "kvm" directory under /var/svc/manifest/
>> or /lib/svc/manifest? Is smf creating a directory for it?
>> 
>> 
>> 
>> 
>> 
>> On 2014-11-05 21:09, Johan Kragsterman wrote:
>>> Hi!
>>> 
>>> 
>>> I'm on my way to try to get my KVM VM's under SMF control. Have been
>>> looking at various exampel xml-files, and there is something I'm not
>>> clear about, that I'd like to ask those who knows how to handle this.
>>> 
>>> The service name in this example looks like this: <service
>>> name='kvm/pfsense'
>>> 
>>> But there is no directory for "kvm" under /var/svc/manifest/ or
>>> /lib/svc/manifest, so where does it go? is svc creating a directory
>>> when I import the file?
>>> 
>>> 
>>> I'd used the example on the omnios wiki, just changed the service
>>> name. It looks like this in my version:
>>> 
>>> 
>>> <?xml version='1.0'?>
>>> <!DOCTYPE service_bundle SYSTEM
>>> '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
>>> <service_bundle type='manifest' name='export'>
>>> <service name='kvm/pfsense' type='service' version='0'>
>>> <create_default_instance enabled='true'/>
>>> <single_instance/>
>>> <dependency name='network'
>>> grouping='require_all'
>>> restart_on='none'
>>> type='service'>
>>> <service_fmri value='svc:/milestone/network:default' />
>>> </dependency>
>>> <dependency name='filesystem'
>>> grouping='require_all'
>>> restart_on='none'
>>> type='service'>
>>> <service_fmri value='svc:/system/filesystem/local:default' />
>>> </dependency>
>>> <exec_method name='start'
>>> type='method'
>>> exec='/usr/bin/vmpfsense.sh'
>>> timeout_seconds='60'/>
>>> <exec_method name='stop'
>>> type='method'
>>> exec='/usr/bin/vmpfsense.sh'
>>> timeout_seconds='60'/>
>>> <exec_method name='stop'
>>> type='method'
>>> exec=':kill'
>>> timeout_seconds='60'/>
>>> <stability value='Unstable'/>
>>> <template>
>>> <common_name>
>>> <loctext xml:lang='C'>KVM-pfsense</loctext>
>>> <common_name>
>>> <template>
>>> </service>
>>> </service_bundle>
>>> 
>>> 
>>> 
>>> 
>>> What do you think, would that do?
>>> 
>>> 
>>> 
>>> 
>>> Best regards from/Med vänliga hälsningar från
>>> 
>>> Johan Kragsterman
>>> 
>>> Capvert
>>> 
>>> _______________________________________________
>>> OmniOS-discuss mailing list
>>> OmniOS-discuss at lists.omniti.com
>>> http://lists.omniti.com/mailman/listinfo/omnios-discuss





More information about the OmniOS-discuss mailing list