This message was deleted.
# harvester
a
This message was deleted.
f
Advanced Options
a
Thank you, that works perfectly. May I ask if you know where to look for allowed options in YAML configs? It seems modifying children of existing properties work, but adding new ones is ignored.
f
a
Yes, I'm using that, but options keep disappeared after being saved. Or perhaps, I mistyped them and Harvester invalidate the properties? Certain property such as disk serial is saved without an issue.
f
Can you provide your yaml?
all options of kubevirt are allowed
a
It happens with every YAML, not isolated to any of them. Here is an example of the VM I'm working on.
Copy code
apiVersion: <http://kubevirt.io/v1|kubevirt.io/v1>
kind: VirtualMachine
metadata:
  annotations:
    <http://harvesterhci.io/vmRunStrategy|harvesterhci.io/vmRunStrategy>: RerunOnFailure
    <http://harvesterhci.io/volumeClaimTemplates|harvesterhci.io/volumeClaimTemplates>: >-
      [{"metadata":{"name":"home-assistant-installer-unl6v","annotations":{"<http://harvesterhci.io/imageId|harvesterhci.io/imageId>":"default/image-wg4qb"}},"spec":{"accessModes":["ReadWriteMany"],"resources":{"requests":{"storage":"16Gi"}},"volumeMode":"Block","storageClassName":"longhorn-image-wg4qb"}}]
    <http://kubevirt.io/latest-observed-api-version|kubevirt.io/latest-observed-api-version>: v1
    <http://kubevirt.io/storage-observed-api-version|kubevirt.io/storage-observed-api-version>: v1alpha3
    <http://network.harvesterhci.io/ips|network.harvesterhci.io/ips>: '[]'
  creationTimestamp: '2023-07-03T03:41:59Z'
  finalizers:
    - <http://harvesterhci.io/VMController.UnsetOwnerOfPVCs|harvesterhci.io/VMController.UnsetOwnerOfPVCs>
  generation: 5
  labels:
    <http://harvesterhci.io/creator|harvesterhci.io/creator>: harvester
    <http://harvesterhci.io/os|harvesterhci.io/os>: linux
  managedFields:
    - apiVersion: <http://kubevirt.io/v1alpha3|kubevirt.io/v1alpha3>
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            f:<http://kubevirt.io/latest-observed-api-version|kubevirt.io/latest-observed-api-version>: {}
            f:<http://kubevirt.io/storage-observed-api-version|kubevirt.io/storage-observed-api-version>: {}
        f:spec:
          f:runStrategy: {}
      manager: Go-http-client
      operation: Update
      time: '2023-07-03T03:46:08Z'
    - apiVersion: <http://kubevirt.io/v1|kubevirt.io/v1>
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            .: {}
            f:<http://harvesterhci.io/vmRunStrategy|harvesterhci.io/vmRunStrategy>: {}
            f:<http://harvesterhci.io/volumeClaimTemplates|harvesterhci.io/volumeClaimTemplates>: {}
            f:<http://network.harvesterhci.io/ips|network.harvesterhci.io/ips>: {}
          f:finalizers:
            .: {}
            v:"<http://harvesterhci.io/VMController.UnsetOwnerOfPVCs|harvesterhci.io/VMController.UnsetOwnerOfPVCs>": {}
          f:labels:
            .: {}
            f:<http://harvesterhci.io/creator|harvesterhci.io/creator>: {}
            f:<http://harvesterhci.io/os|harvesterhci.io/os>: {}
        f:spec:
          .: {}
          f:template:
            .: {}
            f:metadata:
              .: {}
              f:annotations:
                .: {}
                f:<http://harvesterhci.io/sshNames|harvesterhci.io/sshNames>: {}
              f:labels:
                .: {}
                f:<http://harvesterhci.io/vmName|harvesterhci.io/vmName>: {}
            f:spec:
              .: {}
              f:affinity:
                f:nodeAffinity:
                  f:preferredDuringSchedulingIgnoredDuringExecution: {}
              f:domain:
                .: {}
                f:cpu:
                  .: {}
                  f:cores: {}
                  f:sockets: {}
                  f:threads: {}
                f:devices:
                  .: {}
                  f:disks: {}
                  f:hostDevices: {}
                  f:inputs: {}
                  f:interfaces: {}
                f:features:
                  .: {}
                  f:acpi:
                    .: {}
                    f:enabled: {}
                  f:smm:
                    .: {}
                    f:enabled: {}
                f:firmware:
                  .: {}
                  f:bootloader:
                    .: {}
                    f:efi:
                      .: {}
                      f:secureBoot: {}
                f:machine:
                  .: {}
                  f:type: {}
                f:resources:
                  .: {}
                  f:limits:
                    .: {}
                    f:cpu: {}
                    f:memory: {}
              f:evictionStrategy: {}
              f:hostname: {}
              f:networks: {}
              f:volumes: {}
      manager: harvester
      operation: Update
      time: '2023-07-03T03:47:01Z'
    - apiVersion: <http://kubevirt.io/v1alpha3|kubevirt.io/v1alpha3>
      fieldsType: FieldsV1
      fieldsV1:
        f:status:
          .: {}
          f:conditions: {}
          f:created: {}
          f:printableStatus: {}
          f:ready: {}
          f:volumeSnapshotStatuses: {}
      manager: Go-http-client
      operation: Update
      subresource: status
      time: '2023-07-03T03:47:48Z'
  name: home-assistant
  namespace: default
  resourceVersion: '92089995'
  uid: 5fed2b16-96d9-44d1-85b4-db06d9019413
spec:
  runStrategy: RerunOnFailure
  template:
    metadata:
      annotations:
        <http://harvesterhci.io/sshNames|harvesterhci.io/sshNames>: '[]'
      creationTimestamp: null
      labels:
        <http://harvesterhci.io/vmName|harvesterhci.io/vmName>: home-assistant
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: <http://network.harvesterhci.io/mgmt|network.harvesterhci.io/mgmt>
                    operator: In
                    values:
                      - 'true'
      domain:
        cpu:
          cores: 1
          sockets: 1
          threads: 1
        devices:
          disks:
            - bootOrder: 1
              disk:
                bus: virtio
              name: installer
            - disk:
                bus: virtio
              name: cloudinitdisk
          inputs:
            - bus: usb
              name: tablet
              type: tablet
          interfaces:
            - bridge: {}
              macAddress: 96:0f:a6:39:f2:06
              model: virtio
              name: default
        #I tried to add the smm/efi manually, but could not save. It works fine using the "Advanced" option.
        features:
          acpi:
            enabled: true
          smm:
            enabled: false
        firmware:
          bootloader:
            efi:
              secureBoot: false
        machine:
          type: q35
        memory:
          guest: 1948Mi
        resources:
          limits:
            cpu: '1'
            memory: 2Gi
          requests:
            cpu: 62m
            memory: 1365Mi
      evictionStrategy: LiveMigrate
      hostname: home-assistant
      networks:
        - multus:
            networkName: default/vlan1-lan
          name: default
      volumes:
        - name: installer
          persistentVolumeClaim:
            claimName: home-assistant-installer-unl6v
        - cloudInitNoCloud:
            networkDataSecretRef:
              name: home-assistant-jan1f
            secretRef:
              name: home-assistant-jan1f
          name: cloudinitdisk
f
I can add the efi option by
Edit Yaml
. Can you check the difference between the yaml you manually modified and the yaml above
Copy code
features:
          acpi:
            enabled: true
          smm:
            enabled: false
        firmware:
          bootloader:
            efi:
              secureBoot: false
a
Let me try creating a new VM and test it out.
It actually works now. I guess I had incorrect indentation then. It would be great if Harvester can notify the errors, rather than silently drop invalid configs. Thanks again for your help!
f
It would be great if Harvester can notify the errors, rather than silently drop invalid configs
That's kubevirt's behavior
👍 1
🙌 1
a
I see, now I learn something new.