Discussion:
svccfg apply profile.xml - network addresses do not change
Darren Reed
2011-08-22 13:34:43 UTC
Permalink
Is there something below that I'm doing wrong?

Darren

Boot device: /***@7c0/***@0/***@8/***@2/***@0,0:a File and args:
SunOS Release 5.11 Version on-hg_ob2 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
DEBUG enabled
misc/forthdebug (170417 bytes) loaded
Hostname: netvirt-b1
Aug 22 06:01:11 svc.startd[100002]: svc:/system/ocm:default: Method
"/lib/svc/method/svc-ocm start" failed with exit status 95.
Aug 22 06:01:11 svc.startd[100002]: system/ocm:default failed fatally:
transitioned to maintenance (see 'svcs -xv' for details)

netvirt-b1 console login: root
Password:
Last login: Mon Aug 22 05:54:42 on console
Oracle Corporation SunOS 5.11 on-hg_ob2 Aug. 16, 2011
SunOS Internal Development: dr146992 2011-Aug-16 [on-hg_ob2]
***@netvirt-b1:~# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu
8232 index 1
inet 127.0.0.1 netmask ff000000
net0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.0.0.10 netmask ff000000 broadcast 10.255.255.255
ether 0:14:4f:af:e:e2
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu
8252 index 1
inet6 ::1/128
net0: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1500 index 2
inet6 ::/0
ether 0:14:4f:af:e:e2
***@netvirt-b1:~# cd /var/svc/profile
***@netvirt-b1:/var/svc/profile# ls
a b c profile.xml
***@netvirt-b1:/var/svc/profile# svccfg apply profile.xml
***@netvirt-b1:/var/svc/profile# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu
8232 index 1
inet 127.0.0.1 netmask ff000000
net0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.0.0.10 netmask ff000000 broadcast 10.255.255.255
ether 0:14:4f:af:e:e2
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu
8252 index 1
inet6 ::1/128
net0: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1500 index 2
inet6 ::/0
ether 0:14:4f:af:e:e2
***@netvirt-b1:/var/svc/profile# grep v4_addr profile.xml
***@netvirt-b1:/var/svc/profile# grep address profile.xml
<propval name='address_type' value='static'/>
<propval name='static_address' type='net_address_v4'
value='10.134.67.103/24'/>
<propval name='default_route' type='net_address_v4' value='10.134.67.1'/>
<net_address_list>
</net_address_list>
<property type='net_address' name='ypservers'>
<net_address_list>
</net_address_list>
***@netvirt-b1:/var/svc/profile# svcadm refresh network
***@netvirt-b1:/var/svc/profile# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu
8232 index 1
inet 127.0.0.1 netmask ff000000
net0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.0.0.10 netmask ff000000 broadcast 10.255.255.255
ether 0:14:4f:af:e:e2
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu
8252 index 1
inet6 ::1/128
net0: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1500 index 2
inet6 ::/0
ether 0:14:4f:af:e:e2
***@netvirt-b1:/var/svc/profile# cp profile.xml profile2.xml
***@netvirt-b1:/var/svc/profile# svccfg apply profile2.xml
***@netvirt-b1:/var/svc/profile# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu
8232 index 1
inet 127.0.0.1 netmask ff000000
net0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.0.0.10 netmask ff000000 broadcast 10.255.255.255
ether 0:14:4f:af:e:e2
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu
8252 index 1
inet6 ::1/128
net0: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1500 index 2
inet6 ::/0
ether 0:14:4f:af:e:e2
***@netvirt-b1:/var/svc/profile# reboot
syncing file systems... done
rebooting...

SC Alert: Host System has Reset
|

Sun Fire(TM) T1000, No Keyboard
Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.30.4.b, 8064 MB memory available, Serial #78581474.
Ethernet address 0:14:4f:af:e:e2, Host ID: 84af0ee2.



Boot device: /***@7c0/***@0/***@8/***@2/***@0,0:a File and args:
SunOS Release 5.11 Version on-hg_ob2 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
DEBUG enabled
misc/forthdebug (170417 bytes) loaded
Hostname: netvirt-b1
Aug 22 06:12:20 svc.startd[100002]: svc:/system/ocm:default: Method
"/lib/svc/method/svc-ocm start" failed with exit status 95.
Aug 22 06:12:20 svc.startd[100002]: system/ocm:default failed fatally:
transitioned to maintenance (see 'svcs -xv' for details)

netvirt-b1 console login: root
Password:
Last login: Mon Aug 22 06:04:48 on console
Oracle Corporation SunOS 5.11 on-hg_ob2 Aug. 16, 2011
SunOS Internal Development: dr146992 2011-Aug-16 [on-hg_ob2]
***@netvirt-b1:~# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu
8232 index 1
net0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.0.0.10 netmask ff000000 broadcast 10.255.255.255
ether 0:14:4f:af:e:e2
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu
8252 index 1
inet6 ::1/128
net0: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1500 index 2
inet6 ::/0
ether 0:14:4f:af:e:e2
***@netvirt-b1:~# cd /var/svc/profile
***@netvirt-b1:/var/svc/profile# cat profile2.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE service_bundle SYSTEM
'/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='profile' name='system configuration'>
...

<service name='network/install' version='1' type='service'>
<instance name='default' enabled='true'>
<property_group name='install_ipv4_interface' type='application'>
<propval name='name' type='astring' value='net0/v4'/>
<propval name='address_type' value='static'/>
<propval name='static_address' type='net_address_v4'
value='10.134.67.103/24'/>

<propval name='default_route' type='net_address_v4' value='10.134.67.1'/>
</property_group>
</instance>
</service>
Darren Reed
2011-08-22 19:04:40 UTC
Permalink
Comment from the net-install service to which your profile is
#
# The network/install service will configure interfaces using the
# property values supplied by the install profile. Once the configuration
# has been applied, the service will not apply another configuration
# unless an unconfiguration has been performed first.
#
The service maintains an SMF property, "config/applied" to track this.
If you don't want to "sysconfig unconfigure", then you'll have to
reset the "config/applied" property to "false". I suppose you could do
that manually or via the profile.
Is this the correct way to change "config/applied" to false?

<service_bundle type='profile' name='system configuration'>
<service name='network/install' version='1' type='service'>
<instance name='default' enabled='true'>
<property_group name='config'>
<propval name='applied' value='false'/>
</property_group>
</service>
</service_bundle>

Cheers,
Darren
Liane Praza
2011-08-22 19:55:40 UTC
Permalink
Post by Darren Reed
Comment from the net-install service to which your profile is applying
#
# The network/install service will configure interfaces using the
# property values supplied by the install profile. Once the configuration
# has been applied, the service will not apply another configuration
# unless an unconfiguration has been performed first.
#
The service maintains an SMF property, "config/applied" to track this.
If you don't want to "sysconfig unconfigure", then you'll have to reset
the "config/applied" property to "false". I suppose you could do that
manually or via the profile.
Is this the correct way to change "config/applied" to false?
<service_bundle type='profile' name='system configuration'>
<service name='network/install' version='1' type='service'>
<instance name='default' enabled='true'>
<property_group name='config'>
<propval name='applied' value='false'/>
</property_group>
</service>
</service_bundle>
I'm not sure if that would work or not. In particular, I thought that the
property group and property value types had to be specified. I assume that
you already have a profile which sets the network/install property values.
<property_group name='config' type='application' >
<propval name='applied' type='boolean' value='false' />
</property_group>
That is how it is defined in the service manifest itself and would, I
assume, work for the profile.
Or you could simply use svccfg to reset the property to false.
Types are inferred if they're set by the manifest already, either in the
original property definition or by the template data. When possible, we
don't like to force the user to supply redundant information.

liane
Darren Reed
2011-08-22 19:53:43 UTC
Permalink
Post by Darren Reed
Comment from the net-install service to which your profile is
#
# The network/install service will configure interfaces using the
# property values supplied by the install profile. Once the
configuration
# has been applied, the service will not apply another configuration
# unless an unconfiguration has been performed first.
#
The service maintains an SMF property, "config/applied" to track
this. If you don't want to "sysconfig unconfigure", then you'll have
to reset the "config/applied" property to "false". I suppose you
could do that manually or via the profile.
Is this the correct way to change "config/applied" to false?
<service_bundle type='profile' name='system configuration'>
<service name='network/install' version='1' type='service'>
<instance name='default' enabled='true'>
<property_group name='config'>
<propval name='applied' value='false'/>
</property_group>
</service>
</service_bundle>
I'm not sure if that would work or not. In particular, I thought that
the property group and property value types had to be specified. I
assume that you already have a profile which sets the network/install
<property_group name='config' type='application' >
<propval name='applied' type='boolean' value='false' />
</property_group>
That is how it is defined in the service manifest itself and would, I
assume, work for the profile.
Or you could simply use svccfg to reset the property to false.
Using the below XML as the only contents for a file that I named "b",
doing an "svccfg apply b" neither returned an error nor worked.

Darren

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE service_bundle SYSTEM
'/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='profile' name='system configuration'>
<service name='network/install' version='1' type='service'>
<instance name='default' enabled='true'>
<property_group name='config' type='application' >
<propval name='applied' type='boolean' value='false' />
</property_group>
<property_group name='install_ipv4_interface' type='application'>
<propval name='name' type='astring' value='net0/v4'/>
<propval name='address_type' value='static'/>
<propval name='static_address' type='net_address_v4'
value='10.134.67.103/24'/>
<propval name='default_route' type='net_address_v4' value='10.134.67.1'/>
</property_group>
</instance>
</service>
</service_bundle>
Liane Praza
2011-08-22 20:08:35 UTC
Permalink
Post by Darren Reed
Post by Darren Reed
Comment from the net-install service to which your profile is applying
#
# The network/install service will configure interfaces using the
# property values supplied by the install profile. Once the configuration
# has been applied, the service will not apply another configuration
# unless an unconfiguration has been performed first.
#
The service maintains an SMF property, "config/applied" to track this.
If you don't want to "sysconfig unconfigure", then you'll have to
reset the "config/applied" property to "false". I suppose you could do
that manually or via the profile.
Is this the correct way to change "config/applied" to false?
<service_bundle type='profile' name='system configuration'>
<service name='network/install' version='1' type='service'>
<instance name='default' enabled='true'>
<property_group name='config'>
<propval name='applied' value='false'/>
</property_group>
</service>
</service_bundle>
I'm not sure if that would work or not. In particular, I thought that
the property group and property value types had to be specified. I
assume that you already have a profile which sets the network/install
<property_group name='config' type='application' >
<propval name='applied' type='boolean' value='false' />
</property_group>
That is how it is defined in the service manifest itself and would, I
assume, work for the profile.
Or you could simply use svccfg to reset the property to false.
Using the below XML as the only contents for a file that I named "b",
doing an "svccfg apply b" neither returned an error nor worked.
I'm fairly convinced that this type of networking configuration only works
at boot time. (Which is unfortunate, of course, but a choice of the
service in question.)

I believe it was only designed to do initial deployment, and thus probably
does not implement a refresh method. That's just a guess, but seems like
it was accurate.

$ svcprop -p refresh network/install
svcprop: Couldn't find property group `refresh' for service
`svc:/network/install'.

liane

Loading...