How to Make Persistent Configuration Changes to a Live Zone

Perform this procedure to make live zone configuration changes that persist across reboots of the zone.

  1. On the global zone, become an administrator.
  2. Make changes to the zone in default mode.
    global$ pfbash zonecfg -z zonename "zonecfg-commands"

    Specify one or more zonecfg subcommands.

    zonename> "zonecfg-commands"

    For the format, see the zonecfg(8) man page.

  3. Apply the changes to the live configuration.
    global$ pfbash zoneadm -z zonename apply

Example 9-1 Reducing the Number of Virtual CPUs in the Live Zone Configuration

This example shows a running kernel zone kz1 that has 16 virtual CPUs configured. The persistent configuration is changed to set the number of VCPUs to 8 and applied to the live configuration. The output shows what happens if the kernel zone cannot stop using some of the CPUs. This might occur if the kernel zone contains a solaris zone that is configured with the dedicated-cpu resource type, for instance.

The live zone reconfiguration tries to satisfy the request by skipping those CPUs that cannot be removed from the kernel zone (the guest) while trying to remove others. When the specified number of CPUs cannot be removed, the operation succeeds partially and the output shows the new number of virtual CPUs.

global$ pfbash zonecfg -z kz1 -r info virtual-cpu
virtual-cpu:
        ncpus: 16
global$ zonecfg -z kz1 'select virtual-cpu;set ncpus=8;end’
global$ zoneadm -z kz1 apply
zone 'kz1': Checking: Modifying virtual-cpu ncpus=8
zone 'kz1': Applying the changes
zone 'kz1': error: dr-cpu failed for cpu id=15: Operation was blocked
zone 'kz1': error:        status: CPU is configured for use by the guest
zone 'kz1': error: dr-cpu failed for cpu id=14: Operation was blocked
zone 'kz1': error:        status: CPU is configured for use by the guest
...
operation continues to try to remove 8 virtual CPUs
...
zone 'kz1': warning: operation succeeded partially for virtual cpus (requested: 8, final: 12)

global$ zonecfg -z kz1 -r info virtual-cpu
virtual-cpu:
        ncpus: 12