Operating System Profiles

In Sunstone you can quickly flavor a VM template by using an Operating System Profile, which will pre-fill part of the template for you. By default, Sunstone ships with a “Windows Optimized” profile which contains some basic Windows-specific optimization settings.

Defining a Profile

  1. Navigate to the profiles directory

    By default found in etc/one/fireedge/sunstone/profiles.

  2. Create a new YAML file

    Name your profile by defining a new .yaml file

  3. Configure the profile

    Define the profile according to the Operating System Profiles schema.

    Here’s an example of a profile that fills in the name of the VM template, the CPU & memory configuration, and sets up the backup strategy.

    ---
    # basic_profile.yaml
    "General":
      NAME: "Example profile"
      CPU: 4
      VCPU: 4
      MEMORY: 8
      MEMORYUNIT: "GB"
    
    "Advanced options":
      Backup:
        BACKUP_CONFIG:
         MODE: "INCREMENT"
         INCREMENT_MODE: "CBT"
         BACKUP_VOLATILE: "Yes"
         FS_FREEZE: "AGENT"
         KEEP_LAST: 7
    

    The profile can then be saved and accessed in Sunstone from the first step in the VM Templates Create/Update dialog:

    os_profile_selector

Profile Chain Loading

It’s also possible to chain-load profiles by referencing one profile from another. This allows you to combine snippets of profiles together more efficiently, combining different optimizations for specialized use cases.

Take for example the default Windows profile that ships with Sunstone:

---
# Windows profile
"General":
  NAME: "Optimized Windows Profile"

"Advanced options":
  OsCpu:
    OS:
      ARCH: X86_64
      SD_DISK_BUS: scsi
      MACHINE: host-passthrough
      FIRMWARE: BIOS
    FEATURES:
      ACPI: "Yes"
      PAE: "Yes"
      APIC: "Yes"
      HYPERV: "Yes"
      LOCALTIME: "Yes"
      GUEST_AGENT: "Yes"
      VIRTIO_SCSI_QUEUES: "auto"
      VIRTIO_BLK_QUEUES: "auto"
      # IOTHREADS:
    CPU_MODEL:
      MODEL: "host-passthrough"
        # FEATURES:
        # - Tunable depending on host CPU support
        # -
    RAW:
      DATA: |-
        <features>
          <hyperv>
            <evmcs state='off'/>
            <frequencies state='on'/>
            <ipi state='on'/>
            <reenlightenment state='off'/>
            <relaxed state='on'/>
            <reset state='off'/>
            <runtime state='on'/>
            <spinlocks state='on' retries='8191'/>
            <stimer state='on'/>
            <synic state='on'/>
            <tlbflush state='on'/>
            <vapic state='on'/>
            <vpindex state='on'/>
          </hyperv>
        </features>
        <clock offset='utc'>
          <timer name='hpet' present='no'/>
          <timer name='hypervclock' present='yes'/>
          <timer name='pit' tickpolicy='delay'/>
          <timer name='rtc' tickpolicy='catchup'/>
        </clock>
      VALIDATE: "Yes"

Now say you want to combine this profile with the basic profile from the previous section. Now you just add the OS_PROFILE attribute to the basic profile’s configuration and reference the other profile from it:

---
# basic_profile.yaml
"General":
  NAME: "Example profile"
  OS_PROFILE: "windows_optimized"
  CPU: 4
  VCPU: 4
  MEMORY: 8
  MEMORYUNIT: "GB"

"Advanced options":
  Backup:
    BACKUP_CONFIG:
     MODE: "INCREMENT"
     INCREMENT_MODE: "CBT"
     BACKUP_VOLATILE: "Yes"
     FS_FREEZE: "AGENT"
     KEEP_LAST: 7

Sunstone now sequentially loads each profile and applies them on top of each other. This means that if two fields modify the same values, e.g., NAME, the last profile to modify that field will be used.

chain_loaded_profiles

Profiles Schema

General Configuration

Field NameTypeDescriptionAllowed Values
NAMEstringTemplate nameAny string
LOGOstringLogo pathAny valid path or URL,
e.g.,
“images/logos/linux.png”
HYPERVISORstringType of hypervisor used“kvm”, “lxc”, “qemu”
DESCRIPTIONstringDescription of the configurationAny string
VROUTERbooleanSpecifies if it’s a virtual router“Yes”, “No”
OS_PROFILEstringOperating system profileAny string
AS_GIDstringInstantiate as Group IDAny valid group ID
AS_UIDstringInstantiate as User IDAny valid user ID
MEMORY_SLOTSnumberNumber of memory slotsAny positive integer
MEMORY_RESIZE_MODEstringMode for resizing memory“BALLOONING”, “HOTPLUG”
MEMORY_MAXnumberMaximum memory allocationAny positive number
MEMORYUNITstringMemory measurement unit“MB”, “GB”, “TB”
VCPU_MAXnumberMaximum number of virtual CPUsAny positive integer
VCPUnumberNumber of virtual CPUs allocatedAny positive integer
CPUnumberNumber of CPUs allocatedAny positive number
MEMORYnumberAmount of memory allocatedAny positive number
DISK_COSTnumberCost associated with disk usageAny positive number
CPU_COSTnumberCost associated with CPU usageAny positive number
MEMORY_COSTnumberCost associated with memory usageAny positive number
MODIFICATIONResource Modification Settings
VCPU
→ maxnumberMaximum value for virtual CPUsAny positive integer
→ minnumberMinimum value for virtual CPUsAny positive integer
→ optionsarrayOptions for virtual CPUsList of options
→ typestringType of virtual CPUs modification“Any value”, “fixed”,
“list”, “range”
CPU
→ maxnumberMaximum value for CPUsAny positive number
→ minnumberMinimum value for CPUsAny positive number
→ optionsarrayOptions for CPUsList of options
→ typestringType of CPUs modification“Any value”, “fixed”,
“list”, “range”
MEMORY
→ maxnumberMaximum memory allocationAny positive number
→ minnumberMinimum memory allocationAny positive number
→ optionsarrayOptions for memoryList of options
→ typestringType of memory modification“Any value”, “fixed”,
“list”, “range”
HOT_RESIZEHot Resize Configuration
→ CPU_HOT_ADD_ENABLEDbooleanEnables hot-add functionality for CPU“Yes”, “No”
→ MEMORY_HOT_ADD_ENABLEDbooleanEnables hot-add functionality for memory“Yes”, “No”
VMGROUPVirtual Machine Group Settings
→ ROLEstringRole within the VM groupAny role identifier
→ VMGROUP_IDstringIdentifier for the VM groupAny valid VM group ID

Advanced Options

All configuration options are grouped by tab.

Storage Configuration

Field NameTypeDescriptionAllowed Values
StorageStorage Configuration
→ DISKarrayList of disk configurations
→→ NAMEstringDisk identifierAny string (e.g.,
“DISK1”, “DISK2”)
→→ CACHEstringCache mode“default”, “unsafe”,
“writethrough”,
“writeback”,
“directsync”
→→ TARGETstringTarget deviceAny string (e.g., “sdc”)
→→ DEV_PREFIXstringDevice prefix (BUS)“vd”, “sd”, “hd”,
“xvd”, “custom”
→→ DISCARDstringDiscard mode“ignore”, “unmap”
→→ IMAGEstringName of the imageAny string,
should match the image ID
→→ IMAGE_IDnumberID of the imageAny positive integer,
should match the image
name
→→ IOstringIO policy“native”, “threads”,
“io_uring”
→→ IOTHREADSnumberNumber of IO threadsAny positive integer
→→ READONLYbooleanRead-only flag“Yes”, “No”
→→ READ_BYTES_SECnumberRead bytes per secondAny positive number
→→ READ_BYTES_SEC_MAXnumberMax read bytes per secondAny positive number
→→ READ_BYTES_SEC_MAX_LENGTHnumberTime period for max read bytes/secAny positive number
→→ READ_IOPS_SECnumberRead IO operations per secondAny positive number
→→ READ_IOPS_SEC_MAXnumberMax read IO operations per secondAny positive number
→→ READ_IOPS_SEC_MAX_LENGTHnumberTime period for max read IOPS/secAny positive number
→→ RECOVERY_SNAPSHOT_FREQnumberSnapshot frequency for recoveryAny positive integer
→→ SIZEnumberSize of the disk in MBAny positive number
→→ SIZE_IOPS_SECnumberSize of IO operations per secondAny positive number
→→ TOTAL_BYTES_SECnumberTotal bytes per secondAny positive number
→→ TOTAL_BYTES_SEC_MAXnumberMax total bytes per secondAny positive number
→→ TOTAL_BYTES_SEC_MAX_LENGTHnumberTime period for max total bytes/secAny positive number
→→ TOTAL_IOPS_SECnumberTotal IO operations per secondAny positive number
→→ TOTAL_IOPS_SEC_MAXnumberMax total IO operations per secondAny positive number
→→ TOTAL_IOPS_SEC_MAX_LENGTHnumberTime period for max total IOPS/secAny positive number
→→ WRITE_BYTES_SECnumberWrite bytes per secondAny positive number
→→ WRITE_BYTES_SEC_MAXnumberMax write bytes per secondAny positive number
→→ WRITE_BYTES_SEC_MAX_LENGTHnumberTime period for max write bytes/secAny positive number
→→ WRITE_IOPS_SECnumberWrite IO operations per secondAny positive number
→→ WRITE_IOPS_SEC_MAXnumberMax write IO operations per secondAny positive number
→→ WRITE_IOPS_SEC_MAX_LENGTHnumberTime period for max write IOPS/secAny positive number

Network Configuration

Field NameTypeDescriptionAllowed Values
NetworkNetwork Configuration
→ NIC | PCIarrayList of NIC or PCI configurations
→→ NAMEstringName of the network interfaceAny string
→→ GATEWAYstringDefault gatewayValid IPv4 address
→→ GATEWAY6stringDefault IPv6 gatewayValid IPv6 address
→→ GUEST_MTUnumberGuest MTU settingAny number (e.g., 1500)
→→ INBOUND_AVG_BWnumberInbound average bandwidthAny positive number
→→ INBOUND_PEAK_BWnumberInbound peak bandwidthAny positive number
→→ INBOUND_PEAK_KBnumberInbound peak kilobytesAny positive number
→→ IPstringIP addressValid IPv4 address
→→ IP6stringIPv6 addressValid IPv6 address
→→ IP6_METHODstringIPv6 configuration method“auto”, “dhcp”, “static”
→→ MACstringMAC addressValid MAC address
→→ METHODstringIP configuration method“auto”, “dhcp”, “static”
→→ MODELstringModel of the network interfaceAny string
→→ NETWORK_ADDRESSstringNetwork addressValid network address
→→ NETWORK_MASKstringNetwork maskValid subnet mask
→→ NETWORK_MODEstringNetwork mode“auto”, “manual”, etc.
→→ OUTBOUND_AVG_BWnumberOutbound average bandwidthAny positive number
→→ OUTBOUND_PEAK_BWnumberOutbound peak bandwidthAny positive number
→→ OUTBOUND_PEAK_KBnumberOutbound peak kilobytesAny positive number
→→ PCI_TYPEstringPCI type“NIC”, “PCI”, “emulated”
→→ RDPbooleanEnable RDP“Yes”, “No”
→→ RDP_DISABLE_AUDIObooleanDisable RDP audio“Yes”, “No”
→→ RDP_DISABLE_BITMAP_CACHINGbooleanDisable RDP bitmap caching“Yes”, “No”
→→ RDP_DISABLE_GLYPH_CACHINGbooleanDisable RDP glyph caching“Yes”, “No”
→→ RDP_DISABLE_OFFSCREEN_CACHINGbooleanDisable RDP offscreen caching“Yes”, “No”
→→ RDP_ENABLE_AUDIO_INPUTbooleanEnable RDP audio input“Yes”, “No”
→→ RDP_ENABLE_DESKTOP_COMPOSITIONbooleanEnable desktop composition in RDP“Yes”, “No”
→→ RDP_ENABLE_FONT_SMOOTHINGbooleanEnable font smoothing in RDP“Yes”, “No”
→→ RDP_ENABLE_FULL_WINDOW_DRAGbooleanEnable full window drag in RDP“Yes”, “No”
→→ RDP_ENABLE_MENU_ANIMATIONSbooleanEnable menu animations in RDP“Yes”, “No”
→→ RDP_ENABLE_THEMINGbooleanEnable theming in RDP“Yes”, “No”
→→ RDP_ENABLE_WALLPAPERbooleanEnable wallpaper in RDP“Yes”, “No”
→→ RDP_RESIZE_METHODstringRDP resize method“display-update”,
“reconnect”
→→ RDP_SERVER_LAYOUTstringRDP server keyboard layoute.g., “en-us-qwerty”
→→ SSHstringEnable SSH“Yes”, “No”
→→ VIRTIO_QUEUESnumberNumber of VirtIO queuesAny positive integer
→→ TYPEstringSet to “NIC” or “PCI” to specify device type“NIC”, “PCI”

OS and CPU Configuration

Field NameTypeDescriptionAllowed Values
OsCpuOS and CPU Configuration
→OSOperating System configuration
→→ ARCHstringArchitecture“x86_64”, “i686”
→→ SD_DISK_BUSstringSD disk bus type“scsi”, “sata”
→→ MACHINEstringMachine typeDependent on Host support
→→ FIRMWAREstringFirmware type“BIOS”, “UEFI” & Host
supported e.g.,
“/usr/share/AAVMF/
AAVMF_CODE.fd”
→→ BOOTstringBoot device orderComma-separated list
e.g., “disk0,disk1,nic0”
→→ KERNELstringKernel image pathAny valid path
→→ KERNEL_DSstringKernel file referencee.g., $FILE[IMAGE_ID=123]
→→ INITRDstringInitrd image pathAny valid path
→→ INITRD_DSstringInitrd file referencee.g., $FILE[IMAGE_ID=456]
→→ ROOTstringRoot device identifierAny string
→→ FIRMWARE_SECUREbooleanEnable secure firmware“Yes”, “No”
→→ KERNEL_CMDstringKernel command-line parametersAny string
→→ BOOTLOADERstringOS bootloaderAny valid path
→→ UUIDstringOperating system UUIDAny string
→FEATURESVirtualization Features
→→ ACPIbooleanACPI setting“Yes”, “No”
→→ PAEbooleanPAE setting“Yes”, “No”
→→ APICbooleanAPIC setting“Yes”, “No”
→→ HYPERVbooleanEnable Hyper-V features“Yes”, “No”
→→ LOCALTIMEbooleanSynchronize guest time with Host“Yes”, “No”
→→ GUEST_AGENTbooleanEnable guest agent“Yes”, “No”
→→ VIRTIO_SCSI_QUEUESstringVirtio SCSI queues configuration“auto” or positive integer
→→ VIRTIO_BLK_QUEUESstringVirtio block queues configuration“auto” or positive integer
→→ IOTHREADSnumberNumber of IO threadsAny positive integer
→CPU_MODELCPU Model Configuration
→→ MODELstringSpecific CPU model“host-passthrough”,
“core2duo”, etc.
→→ FEATURESarrayCPU model featuresList of features
→RAWRaw Configuration Data
→→ TYPEstringType of raw data“kvm”, “qemu”
→→ DATAstringRaw configuration dataAny string
→→ VALIDATEbooleanValidate raw data against libvirt schema“Yes”, “No”

PCI Configuration

Field NameTypeDescriptionAllowed Values
PciDevicesPCI Device Configuration
→PCIarrayPCI Configuration
→→ NAMEstringPCI device identifierPCI + ID, e.g., PCI1, PCI2
→→ CLASSstringPCI class code of the deviceHexadecimal string
→→ DEVICEstringPCI device IDHexadecimal string
→→ VENDORstringPCI vendor IDHexadecimal string
→→ SHORT_ADDRESSstringPCI address of the deviceHexadecimal string

Input/Output Configuration

Field NameTypeDescriptionAllowed Values
InputOutputInput/Output Configuration
→ VIDEOVideo Configuration
→→ TYPEstringType of video device“auto”, “cirrus”, “none”,
“vga”, “virtio”
→→ VRAMnumberVideo RAM allocation in KBAny positive integer
→→ RESOLUTIONstringVideo resolutione.g., “1280x720”
→→ IOMMUbooleanEnable IOMMU support“Yes”, “No”
→→ ATSbooleanEnable Address Translation Service“Yes”, “No”
→ INPUTarrayInput Device Configurations
→→ BUSstringBus type for input device“ps2”, “usb”
→→ TYPEstringType of input device“mouse”, “tablet”
→ GRAPHICSGraphics Configuration
→→ TYPEstringType of graphics interface“VNC”
→→ LISTENstringGraphics listen addressValid IP address or
hostname
→→ PORTstringGraphics access portAny valid port number
→→ KEYMAPstringKeymap configuratione.g., “en-us”
→→ PASSWDstringGraphics access passwordAny string
→→ RANDOM_PASSWDbooleanUse random password for graphics access“Yes”, “No”
→→ COMMANDstringCustom graphics commandAny string

Context Configuration

Field NameTypeDescriptionAllowed Values
ContextContextualization Configuration
→ CONTEXTmappingContext Variables
→→ SSH_PUBLIC_KEYstringSSH public key for the VMAny string e.g.,
“$USER[SSH_PUBLIC_KEY]”
→→ START_SCRIPTstringStart script content (plain or base64)Any string
→→ NETWORKstringInclude network context“Yes”, “No”
→→ TOKENstringInclude authentication token“Yes”, “No”
→→ REPORT_READYstringReport readiness to the system“Yes”, “No”
→→ INIT_SCRIPTSarrayInitialization scriptsList of script names
→→ FILES_DSstringFiles from datastore (space-separated)Any string
→→ Custom Context VariablesmappingUser-defined context variablese.g., CUSTOM_VAR: “123”
→ USER_INPUTSarrayArray of User Input Definitions
→→ namestringName of the user inputAny string
→→ mandatorybooleanWhether the input is mandatorytrue, false
→→ typestringType of the input“password”, “list”,
“listMultiple”, “number”,
“numberFloat”, “range”,
“rangeFloat”, “boolean”
→→ labelstringLabel or description of the inputAny string
→→ optionsarrayList of options for selection inputsList of strings
→→ defaultstringDefault value of the inputAny string
→→ minstringMinimum value (for numeric inputs)Any number
→→ maxstringMaximum value (for numeric inputs)Any number

Scheduled Actions Configuration

Field NameTypeDescriptionAllowed Values
ScheduledActionScheduled Actions Configuration
→ SCHEDULED_ACTIONarrayArray of scheduled action definitions
→→ NAMEstringName of the scheduled actionAny string
→→ ACTIONstringAction to be performed“backup”, “terminate”
“terminate-hard”,
“undeploy”,
“undeploy-hard”,”hold”,
“release”,”stop”,
“suspend”,”resume”,
“reboot”,”reboot-hard”,
“poweroff”,
“poweroff-hard”,
“snapshot-create”,
“snapshot-revert”,
“snapshot-delete”,
“disk-snapshot-create”,
“disk-snapshot-rename”,
“disk-snapshot-revert”
→→ ARGSstringArguments for the actionDepends on ACTION
→→ TIMEnumberScheduled time in Unix timestampPositive integer
→→ REPEATstringType of repetition0: weekly
1: monthly
2: yearly
3: hourly
→→ DAYSstringDays of the week for repeating actionsComma-separated list of
numbers (0 to 6)
→→ END_TYPEstringType of end condition0: never
1: repetition
2: date
→→ END_VALUEnumberValue associated with END_TYPEDepends on END_TYPE

Placement Configuration

Field NameTypeDescriptionAllowed Values
PlacementPlacement Configuration
→ SCHED_DS_RANKstringDatastore scheduling rank expression“FREE_MB”, “-FREE_MB”
→ SCHED_DS_REQUIREMENTSstringDatastore scheduling requirementsExpression string
→ SCHED_RANKstringHost scheduling rank expression“FREE_CPU”, “RUNNING_VMS”,
“-RUNNING_VMS”
→ SCHED_REQUIREMENTSstringHost scheduling requirementsExpression string

NUMA Topology Configuration

Field NameTypeDescriptionAllowed Values
NUMANUMA Configuration
→ TOPOLOGYNUMA Topology Settings
→→ CORESnumberNumber of cores per socketAny positive integer
→→ THREADSnumberNumber of threads per coreAny positive integer
→→ SOCKETSnumberNumber of socketsAny positive integer
→→ HUGEPAGE_SIZEstringSize of hugepages in MB“2”, “1024”
→→ MEMORY_ACCESSstringMemory access mode“private”, “shared”
→→ PIN_POLICYstringNUMA pinning policy“NONE”, “THREAD”,
“SHARED”, “CORE”,
“NODE_AFFINITY”
→→ NODE_AFFINITYstringPreferred NUMA node(s)Comma-separated list of
node IDs

Backup Configuration

Field NameTypeDescriptionAllowed Values
BACKUPBackup Configuration
→ BACKUP_CONFIGBackup Settings
→→ MODEstringBackup mode“FULL”, “INCREMENT”
→→ INCREMENT_MODEstringIncremental backup method“CBT”, “SNAPSHOT”
→→ BACKUP_VOLATILEstringInclude volatile disks in backup“Yes”, “No”
→→ FS_FREEZEstringFilesystem freeze method“NONE”, “AGENT”, “SUSPEND”
→→ KEEP_LASTnumberNumber of backups to keepAny positive integer