Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VirtualDevice (DeviceComplexType) to BaseMultiObjectComplexType #21

Open
stroomdev10 opened this issue Sep 4, 2017 · 3 comments
Open

Comments

@stroomdev10
Copy link
Member

Will allow modelling of CRUD operations on virtual devices.

@at055612
Copy link
Member

I presume VirtualDevice will cover containers (i.e. docker) as well as whole VMs. Also I wonder if it should use its own complex type which is the same as DeviceComplexType but replaces Location with Host (of type DeviceComplexType) to describe the physical host. Or we just add Host to DeviceComplexType to keep things flexible.

Also should we record details of the the virtualisation/containerisation technology (e.g. VMWare, KVM, docker) and maybe the OS somewhere in there.

@burnalting
Copy link
Contributor

If it helps, here is an extract of virtualisation out of Linux auditd. It's not designed to address schema changes, but what is on offer from virtualisation services.

...
        <!-- Virtualisation -->
        <xsl:when test="$act='virt_resource'">
          <xsl:call-template name="emitVirtualResource" />
        </xsl:when>
        <xsl:when test="$act='virt_control'">
          <xsl:call-template name="emitVirtualControl" />
        </xsl:when>
...
  <!-- Virtualisation -->
  <xsl:template name="emitVirtualControl">
    <xsl:choose>
      <xsl:when test="data/virt_control/op/@i = 'start'">
        <Create>
          <Object>
            <Type>
              <xsl:value-of select="concat('VirtualMachine-', data/virt_control/virt/@i)" />
            </Type>
            <Id>
              <xsl:value-of select="data/virt_control/uuid/@i" />
            </Id>
            <Name>
              <xsl:value-of select="data/virt_control/vm/@i" />
            </Name>
          </Object>
          <xsl:call-template name="emitOutcome" />
          <xsl:call-template name="processIncidentals" />
        </Create>
      </xsl:when>
      <xsl:when test="data/virt_control/op/@i = 'stop'">
        <Delete>
          <Object>
            <Type>
              <xsl:value-of select="concat('VirtualMachine-', data/virt_control/virt/@i)" />
            </Type>
            <Id>
              <xsl:value-of select="data/virt_control/uuid/@i" />
            </Id>
            <Name>
              <xsl:value-of select="data/virt_control/vm/@i" />
            </Name>
          </Object>
          <xsl:call-template name="emitOutcome" />
          <xsl:call-template name="processIncidentals" />
        </Delete>
      </xsl:when>
      <xsl:otherwise>
        <Unknown>
          <xsl:call-template name="processIncidentals" />
        </Unknown>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  <xsl:template name="emitVirtualResource">
    <Create>
      <Association>
        <Objects>
          <Object>
            <Type>
              <xsl:value-of select="concat('VirtualMachine-', data/virt_resource/virt/@i)" />
            </Type>
            <Id>
              <xsl:value-of select="data/virt_resource/uuid/@i" />
            </Id>
            <Name>
              <xsl:value-of select="data/virt_resource/vm/@i" />
            </Name>
          </Object>
          <Object>
            <Type>
              <xsl:value-of select="data/virt_resource/resrc/@i" />
            </Type>
            <xsl:if test="data/virt_resource/cgroup">
              <Name>
                <xsl:value-of select="data/virt_resource/cgroup/@i" />
              </Name>
            </xsl:if>
            <xsl:if test="data/virt_resource/new-disk">
              <Name>
                <xsl:value-of select="data/virt_resource/new-disk/@i" />
              </Name>
            </xsl:if>
            <xsl:if test="data/virt_resource/net">
              <Name>
                <xsl:value-of select="data/virt_resource/net/@i" />
              </Name>
            </xsl:if>
            <xsl:if test="data/virt_resource/new-net">
              <Name>
                <xsl:value-of select="data/virt_resource/new-net/@i" />
              </Name>
            </xsl:if>
            <xsl:if test="data/virt_resource/new-chardev">
              <Name>
                <xsl:value-of select="data/virt_resource/new-chardev/@i" />
              </Name>
            </xsl:if>
            <xsl:if test="data/virt_resource/old-mem">
              <Data Name="old-mem" Value="{data/virt_resource/old-mem/@i}" />
            </xsl:if>
            <xsl:if test="data/virt_resource/new-mem">
              <Data Name="new-mem" Value="{data/virt_resource/new-mem/@i}" />
            </xsl:if>
            <xsl:if test="data/virt_resource/old-vcpu">
              <Data Name="old-vcpu" Value="{data/virt_resource/old-vcpu/@i}" />
            </xsl:if>
            <xsl:if test="data/virt_resource/new-vcpu">
              <Data Name="new-vcpu" Value="{data/virt_resource/new-vcpu/@i}" />
            </xsl:if>
            <xsl:if test="data/virt_resource/old-disk">
              <Data Name="old-disk" Value="{data/virt_resource/old-disk/@i}" />
            </xsl:if>
            <xsl:if test="data/virt_resource/old-net">
              <Data Name="old-net" Value="{data/virt_resource/old-net/@i}" />
            </xsl:if>
            <xsl:if test="data/virt_resource/old-chardev">
              <Data Name="old-chardev" Value="{data/virt_resource/old-chardev/@i}" />
            </xsl:if>
            <xsl:if test="data/virt_resource/class">
              <Data Name="class" Value="{data/virt_resource/class/@i}" />
            </xsl:if>
            <xsl:if test="data/virt_resource/acl">
              <Data Name="acl" Value="{data/virt_resource/acl/@i}" />
            </xsl:if>
            <xsl:if test="data/virt_resource/category">
              <Data Name="category" Value="{data/virt_resource/category/@i}" />
            </xsl:if>
            <xsl:if test="data/virt_resource/path">
              <Data Name="path" Value="{data/virt_resource/path/@i}" />
            </xsl:if>
          </Object>
        </Objects>
        <xsl:call-template name="processIncidentals" />
      </Association>
      <xsl:call-template name="emitOutcome" />
    </Create>
  </xsl:template>
...

@at055612
Copy link
Member

at055612 commented Jun 7, 2024

Proposed addition is this

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants