Simulate Oracle Cloud on KVM/OLVM


12.04.2025
by Kamil Stawiarski

We have no idea when Oracle 23ai will be released on premises. And it is a shame, since this database is offering a lot of great features that you probably would like to learn!

One of the solutions is to use Oracle Cloud to learn, another is to use the Oracle Free version… but if you want to experiment in your own KVM or OLVM environment, you can do it quite easily.

When you run STRACE on Oracle Database startup process, you will find, that it checks the following:

43872 read(13</sys/devices/virtual/dmi/id/chassis_asset_tag>, "\n", 15) = 1

In OCI environment, this "file" contains the one entry:

OracleCloud.com

The question is – can I make my VM have the same entry? Of course you can! On a simple KVM you can add an entry to your domain XML under the SYSINFO node:

<chassis>
      <entry name='asset'>OracleCloud.com</entry>
</chassis>

So the SYSINFO should look like this:

<sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>oVirt</entry>
      <entry name='product'>RHEL</entry>
      <entry name='version'>8.10-1.0.7.el8</entry>
      <entry name='serial'>99cb00c0-0eb3-44a2-a9be-e1d7c82e59c5</entry>
      <entry name='uuid'>d454a0d8-de89-4eee-9d95-60ac61cd8ba5</entry>
      <entry name='family'>oVirt</entry>
    </system>
    <chassis>
      <entry name='asset'>OracleCloud.com</entry>
    </chassis>
  </sysinfo>

It is a bit more challenging to add this to your OLVM (ovirt) machine, but it is not impossible 🙂

OLVM (and oVirt of course) provide hooks – you can think of them as triggers that are executed on specific events. Those hooks are located here:

[root@olvm2 before_vm_start]# ls /usr/libexec/vdsm/hooks
after_device_create               after_update_device                before_get_stats
after_device_destroy              after_update_device_fail           before_get_vm_stats
after_device_migrate_destination  after_vdsm_stop                    before_memory_hotplug
after_device_migrate_source       after_vm_cont                      before_network_setup
after_disk_hotplug                after_vm_dehibernate               before_nic_hotplug
after_disk_hotunplug              after_vm_destroy                   before_nic_hotunplug
after_disk_prepare                after_vm_hibernate                 before_set_num_of_cpus
after_get_all_vm_stats            after_vm_migrate_destination       before_update_device
after_get_caps                    after_vm_migrate_source            before_vdsm_start
after_get_stats                   after_vm_pause                     before_vm_cont
after_get_vm_stats                after_vm_set_ticket                before_vm_dehibernate
after_hostdev_list_by_caps        after_vm_start                     before_vm_destroy
after_memory_hotplug              before_device_create               before_vm_hibernate
after_network_setup               before_device_destroy              before_vm_migrate_destination
after_network_setup_fail          before_device_migrate_destination  before_vm_migrate_source
after_nic_hotplug                 before_device_migrate_source       before_vm_pause
after_nic_hotplug_fail            before_disk_hotplug                before_vm_set_ticket
after_nic_hotunplug               before_disk_hotunplug              before_vm_start
after_nic_hotunplug_fail          before_get_all_vm_stats
after_set_num_of_cpus             before_get_caps

We will create a new file in before_vm_start:

/usr/libexec/vdsm/hooks/before_vm_start

Let’s name the file: 51_oracle_cloud

And this is how it looks like:

[root@olvm2 before_vm_start]# cat 51_oracle_cloud 
#!/usr/libexec/platform-python

import os
import hooking

domxml = hooking.read_domxml()

sysinfo = domxml.getElementsByTagName("sysinfo")[0]

chassis = domxml.createElement('chassis')
entry = domxml.createElement('entry')
entry.setAttribute('name','asset')
oracle_cloud = domxml.createTextNode('OracleCloud.com')
entry.appendChild(oracle_cloud)
chassis.appendChild(entry)
sysinfo.appendChild(chassis)

hooking.write_domxml(domxml)

That’s it! Now each time a VM starts, a new chassis tag is inserted!

Have fun with your in-house 23ai cloud 😀


Contact us

Database Whisperers sp. z o. o. sp. k.
al. Jerozolimskie 200, 3rd floor, room 342
02-486 Warszawa
NIP: 5272744987
REGON:362524978
+48 508 943 051
+48 661 966 009
info@ora-600.pl

Newsletter Sign up to be updated