-- ****************************************************************************
-- ****************************************************************************
--             Copyright(c) 2004 Mediatrix Telecom, Inc.
--  NOTICE:
--   This document contains information that is confidential and proprietary
--   to Mediatrix Telecom, Inc.
--   Mediatrix Telecom, Inc. reserves all rights to this document as well as
--   to the Intellectual Property of the document and the technology and
--   know-how that it includes and represents.
--   This publication cannot be reproduced, neither in whole nor in part in
--   any form whatsoever without written prior approval by
--   Mediatrix Telecom, Inc.
--   Mediatrix Telecom, Inc. reserves the right to revise this publication
--   and make changes at any time and without the obligation to notify any
--   person and/or entity of such revisions and/or changes.
-- ****************************************************************************
-- ****************************************************************************

MX-VM-MIB
DEFINITIONS ::= BEGIN

IMPORTS
        MODULE-IDENTITY,
        OBJECT-TYPE,
        Unsigned32,
        Integer32
    FROM SNMPv2-SMI
        MODULE-COMPLIANCE,
        OBJECT-GROUP
    FROM SNMPv2-CONF
        MxEnableState,
        MxActivationState,
        MxIpHostName,
        MxIpAddress,
        MxIpPort,
        MxAdvancedIpPort,
        MxIpSubnetMask,
        MxDigitMap
    FROM MX-TC
        MxUInt64,
        MxFloat32,
        MxIpHostNamePort,
        MxIpAddr,
        MxIpAddrPort,
        MxIpAddrMask,
        MxUri,
        MxUrl
    FROM MX-TC2
        mediatrixServices
    FROM MX-SMI2;

vmMIB MODULE-IDENTITY
 LAST-UPDATED   "1910210000Z"
 ORGANIZATION " Mediatrix Telecom, Inc. "
 CONTACT-INFO " Mediatrix Telecom, Inc.
                4229, Garlock Street
                Sherbrooke (Quebec)
                Canada
                Phone: (819) 829-8749
                "
 DESCRIPTION  " Virtual Machine

                The Virtual Machine (VM) service allows the administrator to
                manage virtual machines.
                "
 ::= { mediatrixServices 4500 }

vmMIBObjects OBJECT IDENTIFIER ::= { vmMIB 1 }

-- ****************************************************************************

-- Group:Configuration Group

-- ****************************************************************************

configGroup OBJECT IDENTIFIER
 ::= { vmMIBObjects 100 }
 -- ***************************************************************************
 
 -- Table:Virtual Machine Config

 -- ***************************************************************************
 
 vmTable OBJECT-TYPE
  SYNTAX        SEQUENCE OF VmEntry
  MAX-ACCESS    not-accessible
  STATUS        current
  DESCRIPTION " Virtual Machine Config

                This table contains the parameters used to configure the VMs.

                The changes to this table are applied on execution of the
                VM.StartVm command or when the Vm service is restarted.

                "
  ::= { configGroup 100 }
  vmEntry OBJECT-TYPE
   SYNTAX        VmEntry
   MAX-ACCESS    not-accessible
   STATUS        current
   DESCRIPTION " A row in table Virtual Machine Config. "
   INDEX         {
                   vmIdx
                 }

   ::= { vmTable 1 }

  VmEntry ::= SEQUENCE
  {
    vmIdx               Unsigned32,
    vmName              OCTET STRING,
    vmVncDisplayId      Integer32,
    vmUsbPort           INTEGER,
    vmIsoName           OCTET STRING,
    vmMacAddress        OCTET STRING,
    vmNetworkAdapter    INTEGER,
    vmStartupType       INTEGER,
    vmShutdownTimeout   Unsigned32,
    vmConfigStatus      INTEGER,
    vmStart             INTEGER,
    vmStop              INTEGER,
    vmReboot            INTEGER,
    vmStartFromIsoImage INTEGER,
    vmDelete            INTEGER
  }

  -- Index:Idx

  vmIdx OBJECT-TYPE
   SYNTAX        Unsigned32
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " Idx

                 Unique numerical identifier for a VM.
                 "
   DEFVAL        { 0 }
   ::= { vmEntry 100 }

  -- Row command:Start

  vmStart OBJECT-TYPE
   SYNTAX        INTEGER { noOp(0), start(10) }
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " Start

                 Start this virtual machine.
                 "
   DEFVAL        { noOp }
   ::= { vmEntry 10000 }

  -- Row command:Stop

  vmStop OBJECT-TYPE
   SYNTAX        INTEGER { noOp(0), stop(10) }
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " Stop

                 Stop this virtual machine.
                 "
   DEFVAL        { noOp }
   ::= { vmEntry 10010 }

  -- Row command:Reboot

  vmReboot OBJECT-TYPE
   SYNTAX        INTEGER { noOp(0), reboot(10) }
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " Reboot

                 Reboot this virtual machine.

                 This abruptly resets the power of the VM.

                 IMPORTANT: Doing so may cause corruption or data lost if the
                 VM was writing on the virtual disk.

                 "
   DEFVAL        { noOp }
   ::= { vmEntry 10020 }

  -- Row command:Restart With Boot Menu

  vmStartFromIsoImage OBJECT-TYPE
   SYNTAX        INTEGER { noOp(0), startFromIsoImage(10) }
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " Restart With Boot Menu

                 Start this virtual machine from an ISO Image.
                 "
   DEFVAL        { noOp }
   ::= { vmEntry 10030 }

  -- Row command:Delete

  vmDelete OBJECT-TYPE
   SYNTAX        INTEGER { noOp(0), delete(10) }
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " Delete

                 Delete this virtual machine, along with its VM image and
                 configuration files.
                 "
   DEFVAL        { noOp }
   ::= { vmEntry 10040 }

  -- Columnar:Name

  vmName OBJECT-TYPE
   SYNTAX        OCTET STRING ( SIZE(0..48) )
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " Name

                 VM Name.

                 The name is set when adding a new virtual machine with the
                 CreateVm command. The user cannot modify the name after the
                 VM has been created.

                 "
   DEFVAL        { "" }
   ::= { vmEntry 200 }

  -- Columnar:Vnc Display Id

  vmVncDisplayId OBJECT-TYPE
   SYNTAX        Integer32 ( -1..99 )
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " Vnc Display Id

                 Display Id for Vnc connections.

                 UnitAddress:DisplayId is the syntax to use in VNC clients.
                 The VNC server of a VM listens to the default port 5900 + the
                 DisplayId.

                 Configuring '-1' disables the VNC server for a VM.

                 "
   DEFVAL        { 0 }
   ::= { vmEntry 300 }

  -- Columnar:USB

  vmUsbPort OBJECT-TYPE
   SYNTAX        INTEGER { none(100) , all(200) }
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " USB

                 USB ports associated with this VM.

                   * None: No USB will be associated with this virtual
                     machine.
                   * All: All USB ports will be associated with this virtual
                     machine.

                 When the USB port is associated with a VM, the other VMs
                 cannot use it.

                 "
   DEFVAL        { none }
   ::= { vmEntry 400 }

  -- Columnar:ISO Name

  vmIsoName OBJECT-TYPE
   SYNTAX        OCTET STRING ( SIZE(0..510) )
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " ISO Name

                 Name of ISO file with this VM.

                 The ISO file must be uploaded in the VM/Drives.

                 This file can be used to start the virtual machine or used as
                 a drive during a normal start.

                 "
   ::= { vmEntry 500 }

  -- Columnar:MAC Address

  vmMacAddress OBJECT-TYPE
   SYNTAX        OCTET STRING
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " MAC Address

                 MAC address of the Vm.

                 Only this format is accepted: xx:xx:xx:xx:xx:xx or
                 XX:XX:XX:XX:XX:XX.

                 "
   DEFVAL        { "" }
   ::= { vmEntry 550 }

  -- Columnar:Virtual Network Adapter

  vmNetworkAdapter OBJECT-TYPE
   SYNTAX        INTEGER { e1000(100) , virtio(200) }
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " Virtual Network Adapter

                 Configures the virtualised network adapter for this VM.

                   * E1000: Intel 82545EM emulated network interface card.
                     Highest compatibility, slower performance.
                   * Virtio: Paravirtualised network adapter. Best
                     performance, a specific guest OS VM driver is required.

                 This parameter is effective only if the
                 Eth.Link.VirtualSwitch parameter or the
                 InternalVirtualSwitchEnable parameter is enabled.

                 "
   DEFVAL        { e1000 }
   ::= { vmEntry 560 }

  -- Columnar:StartupType

  vmStartupType OBJECT-TYPE
   SYNTAX        INTEGER { manual(100) , auto(200) }
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " StartupType

                 Startup Type of the VM.

                   * Auto: The virtual machine is automatically started when
                     the Vm service starts.
                   * Manual: The administrator manually starts the virtual
                     machine.

                 "
   DEFVAL        { manual }
   ::= { vmEntry 600 }

  -- Columnar:Shutdown Timeout

  vmShutdownTimeout OBJECT-TYPE
   SYNTAX        Unsigned32 ( 0..240 )
   MAX-ACCESS    read-write
   STATUS        current
   DESCRIPTION " Shutdown Timeout

                 Maximum delay, in seconds, allowed for the VM to stop after
                 an ACPI powerdown command. If this delay expires before the
                 VM has stopped completely by itself, the VM is forced to
                 stop.

                 The Operating System in the VM must support ACPI to properly
                 shutdown, otherwise the VM is forced to stop after this
                 timeout expires.

                 "
   DEFVAL        { 15 }
   ::= { vmEntry 650 }

  -- Columnar:Configuration Status

  vmConfigStatus OBJECT-TYPE
   SYNTAX        INTEGER { valid(100) , uSBNotAvailable(200) , missingVMConfig
                 (300) , needRestartToApplyConfig(400) }
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " Configuration Status

                 Configuration status of the row.

                 Indicates if the configuration of this VM is valid and ready
                 to be applied.

                   * Valid: The current content of the row is valid.
                   * USBNotAvailable: The VM is started witout using USB,
                     because the configured USB is used by another VM.
                   * MissingVMConfig: The config file of VM is missing and the
                     VM cannot be started. This config status is set when the
                     Vm service tries to start a virtual machine but its image
                     and config file are missing in vm/images.
                   * NeedRestartToApplyConfig: The configuration has changed
                     but not applied, Stop and restart the VM to apply new
                     config.

                 "
   ::= { vmEntry 700 }

 -- End of table:Virtual Machine Config

 -- Scalar:Internal Virtual Switch Enable

 internalVirtualSwitchEnable OBJECT-TYPE
  SYNTAX        MxEnableState
  MAX-ACCESS    read-write
  STATUS        current
  DESCRIPTION " Internal Virtual Switch Enable

                Specifies if an internal virtual network interface ? also
                known as a host-only virtual switch - should be created
                between the VM(s) and the host.

                  * Disable: No internal virtual network interface.
                  * Enable: An internal virtual network interface is created
                    with the address and subnet mask specified in the
                    InternalVirtualLinkIpAddr parameter.

                When enabled, the internal virtual switch is listed after the
                'external' virtual switches in the VM(s).

                This internal virtual switch only enables internal
                communications on a known subnet, and does not depend on the
                state of the physical network ports. To allow external
                communications in the VM(s), see the
                Eth.LinksTable.LinksVirtualSwitch parameters.

                "
  DEFVAL        { disable }
  ::= { configGroup 200 }

 -- Scalar:Internal Virtual Switch IP Address

 internalVirtualSwitchIpAddr OBJECT-TYPE
  SYNTAX        MxIpAddrMask
  MAX-ACCESS    read-write
  STATUS        current
  DESCRIPTION " Internal Virtual Switch IP Address

                Specifies the IP address and subnet mask to use on the host
                when the InternalVirtualSwitchEnable parameter is set to
                enable.
                "
  DEFVAL        { "169.254.10.1/24" }
  ::= { configGroup 300 }

-- End of group:Configuration Group

-- ****************************************************************************

-- Group:Status Group

-- ****************************************************************************

statusGroup OBJECT IDENTIFIER
 ::= { vmMIBObjects 200 }
 -- ***************************************************************************
 
 -- Table:VM Status

 -- ***************************************************************************
 
 vmStatusTable OBJECT-TYPE
  SYNTAX            SEQUENCE OF VmStatusEntry
  MAX-ACCESS        not-accessible
  STATUS            current
  DESCRIPTION     " VM Status

                    This table displays the status of the VMs.
                    "
  ::= { statusGroup 200 }
  vmStatusEntry OBJECT-TYPE
   SYNTAX        VmStatusEntry
   MAX-ACCESS    not-accessible
   STATUS        current
   DESCRIPTION " A row in table VM Status. "
   INDEX         {
                   vmStatusIdx
                 }

   ::= { vmStatusTable 1 }

  VmStatusEntry ::= SEQUENCE
  {
    vmStatusIdx                Unsigned32,
    vmStatusName               OCTET STRING,
    vmStatusVncDisplayId       Integer32,
    vmStatusUsbPort            INTEGER,
    vmStatusIsoName            OCTET STRING,
    vmStatusMacAddress         OCTET STRING,
    vmStatusNetworkAdapter     INTEGER,
    vmStatusAllocatedRamMb     Unsigned32,
    vmStatusAllocatedStorageGb Unsigned32,
    vmStatusImageFormat        INTEGER,
    vmStatusAllocatedNbCores   Unsigned32,
    vmStatusState              INTEGER
  }

  -- Index:Idx

  vmStatusIdx OBJECT-TYPE
   SYNTAX        Unsigned32
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " Idx

                 Unique numerical identifier for a VM.
                 "
   ::= { vmStatusEntry 100 }

  -- Columnar:Name

  vmStatusName OBJECT-TYPE
   SYNTAX        OCTET STRING
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " Name

                 VM name.

                 The name is set when adding a new virtual machine with
                 command the AddVM command.

                 The user cannot modify the name after the VM has been
                 created.

                 "
   ::= { vmStatusEntry 200 }

  -- Columnar:Vnc Display Id

  vmStatusVncDisplayId OBJECT-TYPE
   SYNTAX        Integer32
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " Vnc Display Id

                 Display Id for Vnc connection with this VM.

                 UnitAddress:DisplayId is the syntax to use in VNC clients.
                 The VNC server of a VM listens to the default port 5900 + the
                 DisplayId.

                 Configuring '-1' disables the VNC server for a VM.

                 "
   ::= { vmStatusEntry 300 }

  -- Columnar:USB

  vmStatusUsbPort OBJECT-TYPE
   SYNTAX        INTEGER { none(100) , all(200) }
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " USB

                 USB ports associated with this VM.
                 "
   ::= { vmStatusEntry 400 }

  -- Columnar:ISO Name

  vmStatusIsoName OBJECT-TYPE
   SYNTAX        OCTET STRING
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " ISO Name

                 Name of the ISO file with this VM.

                 The ISO file must be uploaded in the VM/Drives.

                 This file can be used to start the virtual machine or used as
                 a drive during a normal start.

                 "
   ::= { vmStatusEntry 500 }

  -- Columnar:MAC Address

  vmStatusMacAddress OBJECT-TYPE
   SYNTAX        OCTET STRING
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " MAC Address

                 MAC address of the Vm.
                 "
   DEFVAL        { "" }
   ::= { vmStatusEntry 550 }

  -- Columnar:Virtual Network Adapter

  vmStatusNetworkAdapter OBJECT-TYPE
   SYNTAX        INTEGER { e1000(100) , virtio(200) }
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " Virtual Network Adapter

                 Virtualised network adapter for this VM.
                 "
   DEFVAL        { e1000 }
   ::= { vmStatusEntry 560 }

  -- Columnar:Allocated RAM

  vmStatusAllocatedRamMb OBJECT-TYPE
   SYNTAX        Unsigned32
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " Allocated RAM

                 Allocated Memory by the VM in MBytes.
                 "
   ::= { vmStatusEntry 600 }

  -- Columnar:Allocated Storage

  vmStatusAllocatedStorageGb OBJECT-TYPE
   SYNTAX        Unsigned32
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " Allocated Storage

                 Allocated Storage by the VM in GBytes.
                 "
   ::= { vmStatusEntry 700 }

  -- Columnar:Storage Format

  vmStatusImageFormat OBJECT-TYPE
   SYNTAX        INTEGER { qcow2(100) , raw(200), unknown(300) }
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " Storage Format

                 VM image format.
                 "
   ::= { vmStatusEntry 710 }

  -- Columnar:Allocated Cores Number

  vmStatusAllocatedNbCores OBJECT-TYPE
   SYNTAX        Unsigned32
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " Allocated Cores Number

                 Number of cores allocated by the VM.
                 "
   ::= { vmStatusEntry 800 }

  -- Columnar:State

  vmStatusState OBJECT-TYPE
   SYNTAX        INTEGER { stopped(100) , started(200), starting(300) ,
                 stopping(400) , invalidConfig(500) }
   MAX-ACCESS    read-only
   STATUS        current
   DESCRIPTION " State

                 State of the VM.

                   * Stopped: The VM is stopped.
                   * Started: The VM is running.
                   * Starting: The VM is being started.
                   * Stopping: The VM is being stopped.
                   * InvalidConfig: The VM configuration is invalid.

                 "
   ::= { vmStatusEntry 900 }

 -- End of table:VM Status

 -- Scalar:ConvertVmImage Result

 convertVmImageResult OBJECT-TYPE
  SYNTAX        INTEGER { none(100) , running(200) , success(300) ,
                errorNotEnoughSpace(400) }
  MAX-ACCESS    read-only
  STATUS        current
  DESCRIPTION " ConvertVmImage Result

                Conversion result returned by the executed ConvertVmImage
                command. The possible results are:

                  * None
                  * Running
                  * Success
                  * Error, not enough space

                "
  ::= { statusGroup 300 }

-- End of group:Status Group

-- ****************************************************************************

-- Group:Notification Messages Configuration

-- ****************************************************************************

notificationsGroup OBJECT IDENTIFIER
 ::= { vmMIBObjects 60010 }
 -- Scalar:Minimal Severity of Notification

 minSeverity OBJECT-TYPE
  SYNTAX        INTEGER { disable(0) , debug(100) , info(200) , warning(300) ,
                error(400) , critical (500) }
  MAX-ACCESS    read-write
  STATUS        current
  DESCRIPTION " Minimal Severity of Notification

                Sets the minimal severity to issue a notification message
                incoming from this service.

                  * Disable: No notification is issued.
                  * Debug: All notification messages are issued.
                  * Info: Notification messages with a 'Informational' and
                    higher severity are issued.
                  * Warning: Notification messages with a 'Warning' and higher
                    severity are issued.
                  * Error: Notification messages with an 'Error' and higher
                    severity are issued.
                  * Critical: Notification messages with a 'Critical' severity
                    are issued.

                "
  DEFVAL        { warning }
  ::= { notificationsGroup 100 }

-- End of group:Notification Messages Configuration

-- ****************************************************************************

-- Group:Configuration Settings

-- ****************************************************************************

configurationGroup OBJECT IDENTIFIER
 ::= { vmMIBObjects 60020 }
 -- Scalar:Need Restart

 needRestartInfo OBJECT-TYPE
  SYNTAX        INTEGER { no(0) , yes(100) }
  MAX-ACCESS    read-only
  STATUS        current
  DESCRIPTION " Need Restart

                Indicates if the service needs to be restarted for the
                configuration to fully take effect.

                  * Yes: Service needs to be restarted.
                  * No: Service does not need to be restarted.

                Services can be restarted by using the
                Scm.ServiceCommands.Restart command.

                "
  ::= { configurationGroup 100 }

-- End of group:Configuration Settings

END
