
--Apple-Mail=_0D15CE0B-0FB7-4D4E-8899-589FA7FB4F4F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I'm trying to change the way a VM is booted, I want an initial setup = with kernel, initrd and cmdline given and later removed. Using the GUI it works fine. But I have no success using the python API. And running with debug = enable, I get this strange result :
PUT /api/vms/8ced0f81-03fd-415b-a8ef-60141de7eeca HTTP/1.1 ... <os type=3D"rhel_7x64"> <boot dev=3D"hd"/> <boot dev=3D"network"/> </os> ... < <os type=3D"rhel_7x64"> < <boot dev=3D"hd"/> < <boot dev=3D"network"/> < <kernel>.../vmlinuz</kernel> < <initrd>.../initrd.img</initrd> < <cmdline>....</cmdline> < </os>
I got this with: os_params =3D params.OperatingSystem() os_params.set_boot(old_os_params.get_boot()) os_params.set_type(old_os_params.get_type()) os_params.set_kernel(None) os_params.set_initrd(None) os_params.set_cmdline(None) self.broker.set_os(os_params) self.broker.update() trying to set kernel and others to empty string is not really better:
<os type=3D"rhel_7x64"> <boot dev=3D"hd"/> <boot dev=3D"network"/> <kernel></kernel> <initrd></initrd> <cmdline></cmdline> </os>
... < <os type=3D"rhel_7x64"> < <boot dev=3D"hd"/> < <boot dev=3D"network"/> < <kernel></kernel> < <initrd></initrd> < <cmdline></cmdline> < </os> What kind of "magic values" the engine uses to removes values ? --Apple-Mail=_0D15CE0B-0FB7-4D4E-8899-589FA7FB4F4F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" = class=3D"">I'm trying to change the way a VM is booted, I want an = initial setup with kernel, initrd and cmdline given and later = removed.<div class=3D""><br class=3D""></div><div class=3D"">Using the = GUI it works fine.</div><div class=3D""><br class=3D""></div><div = class=3D"">But I have no success using the python API. And running with = debug enable, I get this strange result :</div><div class=3D""><br = class=3D""></div><div class=3D""><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">> PUT = /api/vms/8ced0f81-03fd-415b-a8ef-60141de7eeca HTTP/1.1</div></div><div = class=3D"">...</div><div class=3D""><div style=3D"margin: 0px; = font-size: 11px; font-family: Menlo;" class=3D"">> = <os type=3D"rhel_7x64"></div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">> = <boot dev=3D"hd"/></div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">> = <boot dev=3D"network"/></div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">> = </os></div></div><div class=3D"">...</div><div class=3D""><div = style=3D"margin: 0px; font-size: 11px; font-family: Menlo;" = class=3D"">< <os type=3D"rhel_7x64"></div><div = style=3D"margin: 0px; font-size: 11px; font-family: Menlo;" = class=3D"">< <boot = dev=3D"hd"/></div><div style=3D"margin: 0px; font-size: 11px; = font-family: Menlo;" class=3D"">< = <boot dev=3D"network"/></div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">< = <kernel>.../vmlinuz</kernel></div><div style=3D"margin: 0px; = font-size: 11px; font-family: Menlo;" class=3D"">< = <initrd>.../initrd.img</initrd></div><div = style=3D"margin: 0px; font-size: 11px; font-family: Menlo;" = class=3D"">< = <cmdline>....</cmdline></div><div style=3D"margin: 0px; = font-size: 11px; font-family: Menlo;" class=3D"">< = </os></div></div><div class=3D""><br class=3D""></div><div = class=3D"">I got this with:</div><div class=3D""><pre = style=3D"background-color: rgb(255, 255, 255); font-family: Menlo;" = class=3D"">os_params =3D params.OperatingSystem()<br = class=3D"">os_params.set_boot(old_os_params.get_boot())<br = class=3D"">os_params.set_type(old_os_params.get_type())<br = class=3D"">os_params.set_kernel(<span style=3D"color:#000080;" = class=3D"">None</span>)<br class=3D"">os_params.set_initrd(<span = style=3D"color:#000080;" class=3D"">None</span>)<br = class=3D"">os_params.set_cmdline(<span style=3D"color:#000080;" = class=3D"">None</span>)<br class=3D""><span style=3D"color:#94558d;" = class=3D"">self</span>.broker.set_os(os_params)<br class=3D""><span = style=3D"color:#94558d;" class=3D"">self</span>.broker.update()<br = class=3D""></pre><div class=3D"">trying to set kernel and others to = empty string is not really better:</div></div><div class=3D""><div = style=3D"margin: 0px; font-size: 11px; font-family: Menlo;" = class=3D"">> <os type=3D"rhel_7x64"></div><div = style=3D"margin: 0px; font-size: 11px; font-family: Menlo;" = class=3D"">> <boot = dev=3D"hd"/></div><div style=3D"margin: 0px; font-size: 11px; = font-family: Menlo;" class=3D"">> = <boot dev=3D"network"/></div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">> = <kernel></kernel></div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">> = <initrd></initrd></div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">> = <cmdline></cmdline></div><div style=3D"margin: 0px; = font-size: 11px; font-family: Menlo;" class=3D"">> = </os></div></div><div class=3D"">...</div><div class=3D""><div = style=3D"margin: 0px; font-size: 11px; font-family: Menlo;" = class=3D"">< <os type=3D"rhel_7x64"></div><div = style=3D"margin: 0px; font-size: 11px; font-family: Menlo;" = class=3D"">< <boot = dev=3D"hd"/></div><div style=3D"margin: 0px; font-size: 11px; = font-family: Menlo;" class=3D"">< = <boot dev=3D"network"/></div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">< = <kernel></kernel></div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">< = <initrd></initrd></div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">< = <cmdline></cmdline></div><div style=3D"margin: 0px; = font-size: 11px; font-family: Menlo;" class=3D"">< = </os></div></div><div class=3D""><br class=3D""></div><div = class=3D"">What kind of "magic values" the engine uses to removes values = ?</div><div class=3D""><br class=3D""></div></body></html>= --Apple-Mail=_0D15CE0B-0FB7-4D4E-8899-589FA7FB4F4F--