Hi Stephen

Sorry for the delayed reply - been away for a couple of weeks.
This looks interesting - will give it a try with the CPU config - plus we may 
have a need for adding GPU's to specific VM's also !!

BR

Gary


Gary Dixon
Senior Technical Consultant
T:  +44 161 537 4990
E:  v...@quadris-support.com
W: www.quadris.co.uk
The information contained in this e-mail from Quadris may be confidential and 
privileged for the private use of the named recipient.  The contents of this 
e-mail may not necessarily represent the official views of Quadris.  If you 
have received this information in error you must not copy, distribute or take 
any action or reliance on its contents.  Please destroy any hard copies and 
delete this message.
-----Original Message-----
From: Stephan Bienek <stephan....@bienek.org>
Sent: Friday, July 14, 2023 4:19 PM
To: users@cloudstack.apache.org
Subject: Re: over-ride VM CPU config

I am not sure if i understand your concern in regards to hooks, but they 
actually work to modify the generated XML.

We are for example using the following settings in agent.properties to add GPUs 
to specific VMs.

agent.hooks.libvirt_vm_on_start.script=libvirt-vm.groovy
agent.hooks.libvirt_vm_xml_transformer.method=transform
agent.hooks.libvirt_vm_xml_transformer.script=libvirt-vm.groovy
agent.hooks.libvirt_vm_on_stop.script=libvirt-vm.groovy

This was implemented before the nice feature of "extraconfig".

The script libvirt-vm.groovy is adding additional devices (GPUs) to the device 
tree of the VMs XML like

      return new XmlParser().parseText(
        "  <hostdev mode='subsystem' type='mdev' model='vfio-pci'>\n" +
        "    <source>\n" +
        "      <address uuid='6f5c74aa-4c4b-40b7-ad14-c911358db64b'/>\n" +
        "    </source>\n" +
        "  </hostdev>")
    }

Maybe thats what you, Gary, were asking for?
I never tried changing the CPU using this approach.

Best regards,
Stephan

> Wido den Hollander <w...@widodh.nl> hat am 14.07.2023 15:21 CEST geschrieben:
>
>
> Op 14-07-2023 om 14:30 schreef Gary Dixon:
> > Hi Wido
> >
> > So I take it this old feature request to inject custom domain XML
> > wasn't implemented in any version of ACS ?
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcw
> > iki.apache.org%2Fconfluence%2Fdisplay%2FCLOUDSTACK%2FKVM%2Bhook%2Bsc
> > ript%2Binclude&data=05%7C01%7CGary.Dixon%40quadris.co.uk%7Cea7192122
> > 6554a430eab08db847da973%7Cf1d6abf3d3b44894ae16db0fb93a96a2%7C0%7C0%7
> > C638249447480608018%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OTq
> > jEwzkf37lJu3%2Bus3se5cubF5mvj1tLlUn3clzDss%3D&reserved=0
>
> That's for during a migration. That seems to be supported by libvirt.
>
> Not during the start of a VM.
>
> Wido
>
> >
> > Gary Dixon​
> > Senior Technical Consultant
> > T:  +44 161 537 4990
> > E: v <tel:+44%207989717661>ms@quadris‑support.com
> > W:
> > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww
> > .quadris.co.uk%2F&data=05%7C01%7CGary.Dixon%40quadris.co.uk%7Cea7192
> > 1226554a430eab08db847da973%7Cf1d6abf3d3b44894ae16db0fb93a96a2%7C0%7C
> > 0%7C638249447480608018%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiL
> > CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=
> > NxVH7v8ZnuHg%2FcI92fvonPlIq4kv4x9QyhotcFsDrbI%3D&reserved=0
> >
> > The information contained in this e-mail from Quadris may be
> > confidential and privileged for the private use of the named recipient.
> > The contents of this e-mail may not necessarily represent the
> > official views of Quadris.  If you have received this information in
> > error you must not copy, distribute or take any action or reliance
> > on its contents.  Please destroy any hard copies and delete this message.
> >
> >
> > From: Wido den Hollander <w...@widodh.nl>
> > Sent: Friday, July 14, 2023 1:08 PM
> > To: users@cloudstack.apache.org; Gary Dixon
> > <gary.di...@quadris.co.uk>
> > Subject: Re: over-ride VM CPU config
> >
> >
> >
> > Op 14/07/2023 om 13:46 schreef Gary Dixon:
> >  > Thanks Stephen
> >  >
> >  > This would be a great feature to have. I was wondering if for now
> > we  > could achieve our goal using libvirt hooks ?
> >  > https://libv/
> >  >
> > irt.org%2Fhooks.html%23custom-event-scripts&data=05%7C01%7CGary.Dixo
> > n%  >
> > 40quadris.co.uk%7Cb12cb9c94d5a44d29c7408db8462f4ed%7Cf1d6abf3d3b4489
> > 4a  >
> > e16db0fb93a96a2%7C0%7C0%7C638249332779881625%7CUnknown%7CTWFpbGZsb3d
> > 8e  >
> > yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C
> > 30  >
> > 00%7C%7C%7C&sdata=CK%2Fdtn0NtenXsGtxEnRXknZlRVuNc7hEIAWN5WligRg%3D&r
> > es
> >  > erved=0
> >  > <https://lib/
> >  >
> > virt.org%2Fhooks.html%23custom-event-scripts&data=05%7C01%7CGary.Dix
> > on  >
> > %40quadris.co.uk%7Cb12cb9c94d5a44d29c7408db8462f4ed%7Cf1d6abf3d3b448
> > 94  >
> > ae16db0fb93a96a2%7C0%7C0%7C638249332779881625%7CUnknown%7CTWFpbGZsb3
> > d8  >
> > eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7
> > C3  >
> > 000%7C%7C%7C&sdata=CK%2Fdtn0NtenXsGtxEnRXknZlRVuNc7hEIAWN5WligRg%3D&
> > re
> >  > served=0>
> >
> > As far as I know you are not able to modify the XML with hooks.
> >
> > You can act upon the hook prior to starting the VM by looking at the
> > XML and preparing some resources for the VM, but you can't change
> > anything at that point.
> >
> > Please do correct me if I'm wrong.
> >
> > Wido
> >
> >  >
> >  > Gary Dixon​
> >  > Senior Technical Consultant
> >  > T: +44 161 537 4990
> >  > E: v <tel:+44%207989717661>ms@quadris‑support.com
> >  > W:
> >  >
> > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww
> > .q%2F&data=05%7C01%7CGary.Dixon%40quadris.co.uk%7Cea71921226554a430e
> > ab08db847da973%7Cf1d6abf3d3b44894ae16db0fb93a96a2%7C0%7C0%7C63824944
> > 7480608018%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM
> > zIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=pp15SWv7GD6i
> > E%2FwpQFp4wH4w6ehiGn%2FSNq4QDVD8%2BIU%3D&reserved=0
> >  >
> > uadris.co.uk%2F&data=05%7C01%7CGary.Dixon%40quadris.co.uk%7Cb12cb9c9
> > 4d  >
> > 5a44d29c7408db8462f4ed%7Cf1d6abf3d3b44894ae16db0fb93a96a2%7C0%7C0%7C
> > 63  >
> > 8249332779881625%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjo
> > iV  >
> > 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Nl0TSU5c
> > LT  > JqKh4uuKibuBHW%2B24R58zPfp8zhddUH9c%3D&reserved=0
> >  >
> >  > The information contained in this e-mail from Quadris may be  >
> > confidential and privileged for the private use of the named recipient.
> >  > The contents of this e-mail may not necessarily represent the
> > official  > views of Quadris. If you have received this information
> > in error you  > must not copy, distribute or take any action or
> > reliance on its  > contents. Please destroy any hard copies and delete this 
> > message.
> >  >
> >  > *From:*Stephan Bienek <stephan....@bienek.org>  > *Sent:* Friday,
> > July 14, 2023 12:38 PM  > *To:* users@cloudstack.apache.org  >
> > *Subject:* Re: over-ride VM CPU config  >  > Hi Gary,  >  > Lukas
> > had the same requirement and already opened an issue / feature  >
> > request for it  >  > https://gith/  >
> > ub.com%2Fapache%2Fcloudstack%2Fissues%2F7600&data=05%7C01%7CGary.Dix
> > on  >
> > %40quadris.co.uk%7Cb12cb9c94d5a44d29c7408db8462f4ed%7Cf1d6abf3d3b448
> > 94  >
> > ae16db0fb93a96a2%7C0%7C0%7C638249332779881625%7CUnknown%7CTWFpbGZsb3
> > d8  >
> > eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7
> > C3  >
> > 000%7C%7C%7C&sdata=T%2FB5QFzUbaybc9iOIrlpxVIHukmdcI2V2%2FWFHxHRqh8%3
> > D&
> >  > reserved=0
> >  > <https://git/
> >  >
> > hub.com%2Fapache%2Fcloudstack%2Fissues%2F7600&data=05%7C01%7CGary.Di
> > xo  >
> > n%40quadris.co.uk%7Cb12cb9c94d5a44d29c7408db8462f4ed%7Cf1d6abf3d3b44
> > 89  >
> > 4ae16db0fb93a96a2%7C0%7C0%7C638249332779881625%7CUnknown%7CTWFpbGZsb
> > 3d  > 
> > 8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%
> > 7C  >
> > 3000%7C%7C%7C&sdata=T%2FB5QFzUbaybc9iOIrlpxVIHukmdcI2V2%2FWFHxHRqh8%
> > 3D
> >  > &reserved=0>
> >  >
> >  > Best regards,
> >  >
> >  > Stephan
> >  >
> >  > Gary Dixon <gary.di...@quadris.co.uk.invalid  >
> > <mailto:gary.di...@quadris.co.uk.invalid>> hat am 14.07.2023 12:14
> > > CEST geschrieben:
> >  >
> >  > Hi all
> >  >
> >  > ACS 4.15.2
> >  >
> >  > KVM on Ubuntu 20.04
> >  >
> >  > We have a requirement that whenever a VM is deployed from a
> > specific  > template (a Netscaler appliance) that it must over-ride
> > the agent  > properties guest cpu mode = host-passthrough with a
> > specific CPU  > model like so :
> >  >
> >  > Currently the VM gets deployed with these CPU parameters from the
> > > KVM host agent config:
> >  >
> >  >
> >  > <cpu mode='host-passthrough' check='none'>  >  > <topology
> > sockets='1' cores='4' threads='1'/>  >  > </cpu>  >  > And we want
> > to over-ride with this CPU config:
> >  >
> >  > <cpu mode='custom' match='exact' check='full'>  >  > <model
> > fallback='forbid'>EPYC-Rome</model>
> >  >
> >  > <topology sockets='1' cores='4' threads='1'/>  >  > <feature
> > policy='require' name='x2apic'/>  >  > <feature policy='require'
> > name='hypervisor'/>  >  > <feature policy='require' name='xsaves'/>
> > >  > <feature policy='require' name='topoext'/>  >  > </cpu>  >  >
> > We can change it temporarily on a running VM with Virt-Manager – but
> > > I want this config to always be set whenever a VM is deployed from
> > > the template and whenever a deployed VM is stopped and started.
> >  >
> >  > Any assistance would be greatly appreciated  >  > BR  >  > Gary
> > >  > *Gary Dixon**​***  >  > Senior Technical Consultant  >  > T:
> > +44 161 537 4990  >  > E: v
> > <tel:+44%207989717661>ms@quadris‑support.com
> >  >
> >  > W:
> >  >
> > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww
> > .q%2F&data=05%7C01%7CGary.Dixon%40quadris.co.uk%7Cea71921226554a430e
> > ab08db847da973%7Cf1d6abf3d3b44894ae16db0fb93a96a2%7C0%7C0%7C63824944
> > 7480764250%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM
> > zIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EXh2dKHNrRjA
> > B%2F036%2BKUbk63Fqi%2B%2BFcWiWGeTKsMKo8%3D&reserved=0
> >  >
> > uadris.co.uk%2F&data=05%7C01%7CGary.Dixon%40quadris.co.uk%7Cb12cb9c9
> > 4d  >
> > 5a44d29c7408db8462f4ed%7Cf1d6abf3d3b44894ae16db0fb93a96a2%7C0%7C0%7C
> > 63  >
> > 8249332779881625%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjo
> > iV  >
> > 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Nl0TSU5c
> > LT  > JqKh4uuKibuBHW%2B24R58zPfp8zhddUH9c%3D&reserved=0
> >  > <http://www/.
> >  >
> > quadris.co.uk%2F&data=05%7C01%7CGary.Dixon%40quadris.co.uk%7Cb12cb9c
> > 94  >
> > d5a44d29c7408db8462f4ed%7Cf1d6abf3d3b44894ae16db0fb93a96a2%7C0%7C0%7
> > C6  >
> > 38249332779881625%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIj
> > oi  >
> > V2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Nl0TSU5
> > cL  > TJqKh4uuKibuBHW%2B24R58zPfp8zhddUH9c%3D&reserved=0>
> >  >
> >  > *The information contained in this e-mail from Quadris may be  >
> > confidential and privileged for the private use of the named  >
> > recipient. The contents of this e-mail may not necessarily  >
> > represent the official views of Quadris. If you have received this
> > > information in error you must not copy, distribute or take any  >
> > action or reliance on its contents. Please destroy any hard copies
> > > and delete this message.***  >

Reply via email to