xapi-project / xapi-xe

The xapi command-line interface
Other
6 stars 7 forks source link

Wrong template other-config parameter breaks XenCenter connection #14

Open taur-firiath opened 7 years ago

taur-firiath commented 7 years ago

Hello. Today I was going to install Debian 8 on XenServer 7.1. I tired reduce VDI size in template. I did it before on XenServer 6.5 and older. As far as I remember, xe command did not allow invalid parameter. Today i forgot setting parameter syntax. And type xe template-param-set other-config:"import_task: OpaqueRef:6848c113-13f1-c723-5c2b-d1ea2d31e9df; mac_seed: 18b125a3-4860-4f25-a62a-12392431f0fc; install-methods: cdrom,nfs,http,ftp; disks: <provision><disk bootable="true" device="0" size="4294967296" sr="" type="system"/></provision>; default_template: true; linux_template: true" uuid=79abf1d8-4b61-4fc3-aafa-58b0ccae48d3. Like default but change disk size from 8GB to 4. Then XenCenter lost connection with server. And on reconnection i get error Response from server does not contain valid XML. Then i try clear other-config and set again as above (through SSH). But nothing changed. Template can not be deleted under normal conditions. But because template corrupted I could do it. And i did it. Then XenCenter can connect to server. But i lost template. (Clear parameter also helps but i found this out after template deleting). I tried export / import template. On fresh XenServer i did export xe template-export template-uuid=79abf1d8-4b61-4fc3-aafa-58b0ccae48d3 filename=debian8. On "production" server run import xe vm-import filename=debian8 and get error pointed to OpaqueRef:NULL. Then i found xcp-guest-templates repository and just run /etc/firstboot.d/62-create-guest-templates start. It recreates all templates and problem solved.

I think that it will be very cool if xe not allow to save invalid parameter. And XenCenter connection loss is very bad. Not big deal if i can not create VM from template. But connection with all host...

other-config section in exported (XML, xva) default template:

<name>other_config</name>
<value>
    <struct>
        <member>
            <name>import_task</name>
            <value>OpaqueRef:b362de1f-0211-500e-a1e8-d5d346ce1bf8</value>
        </member>
        <member>
            <name>mac_seed</name>
            <value>b8ac542a-00c1-441e-9cef-678402ac4738</value>
        </member>
        <member>
            <name>install-methods</name>
            <value>cdrom,nfs,http,ftp</value>
        </member>
        <member>
            <name>disks</name>
            <value>&lt;provision&gt;&lt;disk bootable=&quot;true&quot; device=&quot;0&quot; size=&quot;8589934592&quot; sr=&quot;&quot; type=&quot;system&quot;/&gt;&lt;/provision&gt;</value>
        </member>
        <member>
            <name>default_template</name>
            <value>true</value>
        </member>
        <member>
            <name>linux_template</name>
            <value>true</value>
        </member>
    </struct>
</value>

other-config section in exported (XML, xva) corrupted template:

<name>other_config</name>
<value>
    <struct>
        <member>
            <name>import_task: OpaqueRef:959d7d81-dae5-b621-c7e5-8818f076b6af; mac_seed: 9b4bcc5e-c921-432b-a72f-7c0f7c4e5fc1; install-methods: cdrom,nfs,http,ftp; disks: &lt;provision&gt;&lt;disk bootable</name>
            <value>true device=0 size=8589934592 sr= type=system/&gt;&lt;/provision&gt;; default_template: true; linux_template: true</value>
        </member>
    </struct>
</value>
taur-firiath commented 7 years ago

Sorry for bad english and for posting in possibly wrong bug tracker.