omniosorg / zadm

zone management tool
https://omnios.org/setup/zadm
GNU General Public License v3.0
23 stars 8 forks source link

Execution of validator for 'physical' returns with error #83

Closed sjorge closed 3 years ago

sjorge commented 3 years ago
sjorge@saturn:~$ zadm create -b lipkg amethyst
root->capped-memory: Execution of validator for 'physical' returns with error: physical capped-memory is not valid. check man zonecfg (2.5G)
root->capped-memory: Execution of validator for 'swap' returns with error: swap capped-memory is not valid. check man zonecfg (2.5G)
Do you want to retry [Y/n]? y

I am creating a zone on a different node using zadm show zone on the original host to get the json

{
   "autoboot" : "true",
   "bootargs" : "",
   "brand" : "lipkg",
   "capped-cpu" : {
      "ncpus" : "1.00"
   },
   "capped-memory" : {
      "physical" : "2.5G",
      "swap" : "2.5G"
   },
   "dataset" : [
      {
         "name" : "rpool/vmdata/amethyst"
      }
   ],
   "fs-allowed" : "",
   "hostid" : "",
   "ip-type" : "exclusive",
   "limitpriv" : "default",
   "net" : [
      {
         "global-nic" : "ixgbe0",
         "mac-addr" : "xxx",
         "physical" : "amethyst0",
         "vlan-id" : "110"
      }
   ],
   "pool" : "",
   "scheduling-class" : "",
   "zonename" : "amethyst",
   "zonepath" : "/zones/amethyst"
}

It would expect the output of show to be usable as a create payload.

hadfl commented 3 years ago

zadm has never supported fractional numbers for capped-memory, you likely set them initially with zonecfg. zadm will only re-validate the zone config before a zone config is written (i.e. on creation or when editing) but not when showing the config.

see: https://github.com/omniosorg/zadm/blob/master/lib/Zadm/Schema/base.pm#L153; this code didn't change since the initial commit.

However, if fractional numbers are supported by zonecfg zadm should do as well.

sjorge commented 3 years ago

Oh yeah that could very well have come from a zonecfg change.

root@jupiter:~# zonecfg -z amethyst info
zonename: amethyst
zonepath: /zones/amethyst
brand: lipkg
autoboot: true
bootargs:
pool:
limitpriv: default
scheduling-class:
ip-type: exclusive
hostid:
fs-allowed:
capped-cpu:
    [ncpus: 1.00]
capped-memory:
    [physical: 2.5G]
    [swap: 2.5G]
dataset:
    name: rpool/vmdata/amethyst
rctl:
    name: zone.cpu-cap
    value: (priv=privileged,limit=100,action=deny)
rctl:
    name: zone.max-physical-memory
    value: (priv=privileged,limit=2684354560,action=deny)
rctl:
    name: zone.max-swap
    value: (priv=privileged,limit=2684354560,action=deny)

Edit: thats the new one, let me grab the old one from a backup Edit2: grabbed it from backup, it shows as factional for capped-memory but shows a int under rctl.