[ovirt-users] VM manipulate DMI Chassis Serial value

Juan Hernández jhernand at redhat.com
Tue Jan 26 16:41:06 UTC 2016


On 01/22/2016 10:01 PM, Nir Soffer wrote:
> Adding Francesco
> 
> On Fri, Jan 22, 2016 at 1:40 PM,  <ovirt at timmi.org> wrote:
>> Hi list,
>>
>> it is possible to change the DMI Chassis Serial value in the VM config?
>>
>> Virtualbox is able to perform this via the following command for example:
>> c:\Program Files\Oracle\VirtualBox\VBoxManage.exe setextradata
>> "NAME_OF_VIRTUAL_MACHINE"
>> "VBoxInternal/Devices/pcbios/0/Config/DmiChassisSerial" "123456789"
>>
>> Handle 0x0300, DMI type 3, 21 bytes
>> Chassis Information
>>     Manufacturer: Red Hat
>>     Type: Other
>>     Lock: Not Present
>>     Version: RHEL 7.2.0 PC (i440FX + PIIX, 1996)
>>     Serial Number: Not Specified
>>     Asset Tag: Not Specified
>>     Boot-up State: Safe
>>     Power Supply State: Safe
>>     Thermal State: Safe
>>     Security Status: Unknown
>>     OEM Information: 0x00000000
>>     Height: Unspecified
>>     Number Of Power Cords: Unspecified
>>     Contained Elements: 0
>>
>> root at demo:~ # dmidecode -s chassis-serial-number
>> Not Specified
>>
>>
>> I want to change the red above!!
>> Is there a way to change that in Ovirt as well?
>>
>> Best regards and thank you for your help.
>> Christoph
>>

You should be able to change it from the GUI: Edit -> Show Advanced
Options -> System -> General -> Provide Custom serial number policy ->
Custom serial number.

You can also change it with the API, for example with the Python SDK:

---8<---
#!/usr/bin/python

from ovirtsdk.api import API
from ovirtsdk.xml import params

# Connect to the server:
api = API(
    url="https://rhevm36.example.com/ovirt-engine/api",
    username="admin at internal",
    password="...",
    ca_file="/etc/pki/ovirt-engine/ca.pem",
    debug=True
)

# Find the VM:
vm = api.vms.get(name="myvm")

# Set a custom serial number:
vm.set_serial_number(
    params.SerialNumber(
        policy="custom",
        value="myserialnumber",
    )
)
vm.update()

# Disconnect:
api.disconnect()
--->8---


-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.



More information about the Users mailing list