Arik Hadas has uploaded a new change for review. Change subject: create VMs in a bulk ......................................................................
create VMs in a bulk Change-Id: Ifd50b9fc694ec7c84b3b39f3d11edb1495842244 Signed-off-by: Arik Hadas <aha...@redhat.com> --- M vdsm/API.py M vdsm/BindingXMLRPC.py M vdsm_api/Bridge.py M vdsm_api/vdsmapi-schema.json 4 files changed, 38 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/22452/1 diff --git a/vdsm/API.py b/vdsm/API.py index 44d5817..391dc9a 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -1266,6 +1266,11 @@ for v in self._cif.vmContainer.values() if not vmSet or v.id in vmSet]} + def createAll(self, vmsParams): + return {'status': doneCode, + 'vmList': [VM(v['vmId']).create(v) + for v in vmsParams]} + # Networking-related functions def setupNetworks(self, networks, bondings, options): """Add a new network to this vds, replacing an old one.""" diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py index 5bcd84c..3078d73 100644 --- a/vdsm/BindingXMLRPC.py +++ b/vdsm/BindingXMLRPC.py @@ -214,6 +214,10 @@ vm = API.VM(vmParams['vmId']) return vm.create(vmParams) + def createAll(self, vmsParams): + api = API.Global() + return api.createAll(vmsParams) + def getVMList(self, fullStatus=False, vmList=()): api = API.Global() return api.getVMList(fullStatus, vmList) @@ -814,6 +818,7 @@ def getGlobalMethods(self): return ((self.vmDestroy, 'destroy'), (self.vmCreate, 'create'), + (self.createAll, 'createAll'), (self.getVMList, 'list'), (self.vmPause, 'pause'), (self.vmCont, 'cont'), diff --git a/vdsm_api/Bridge.py b/vdsm_api/Bridge.py index f4d533c..f0b4653 100644 --- a/vdsm_api/Bridge.py +++ b/vdsm_api/Bridge.py @@ -232,6 +232,18 @@ return [v['vmId'] for v in ret['vmList']] +#def Host_createAll_Call(api, args): +# vmParams = args.get('vmParams', []) +# return API.Global().createAll(vmParams) + + +#def Host_createAll_Ret(ret): +# """ +# Just return a list of VM UUIDs +# """ +# return [v['vmId'] for v in ret['vmList']] + + def StoragePool_getInfo_Ret(ret): """ The result contains two data structures which must be merged diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json index 77ca409..33ef756 100644 --- a/vdsm_api/vdsmapi-schema.json +++ b/vdsm_api/vdsmapi-schema.json @@ -2941,6 +2941,22 @@ 'returns': ['UUID']} ## +# @Host.createAll: +# +# Get information about the current virtual machines. +# +# @vmParams: #optional Filter the results by a list of UUIDs +# +# Returns: +# A list of VM UUIDs +# +# Since: 4.10.0 +## +{'command': {'class': 'Host', 'name': 'createAll'}, + 'data': { '*vmParams': 'VmParameters'}, + 'returns': 'VmDefinition'} + +## # @Host.ping: # # Test connectivity to vdsm. -- To view, visit http://gerrit.ovirt.org/22452 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd50b9fc694ec7c84b3b39f3d11edb1495842244 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Arik Hadas <aha...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches