From: Masaki Kanno Subject: Re: Many same managed domain Date: Tue, 24 Jul 2007 12:12:24 +0900 Message-ID: <9BC7CDA074E023kanno.masaki@jp.fujitsu.com> References: <91C7CC1E6AF558kanno.masaki@jp.fujitsu.com> <20070722144609.GA22043@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20070722144609.GA22043@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Daniel P. Berrange" Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >On Sun, Jul 22, 2007 at 02:09:01PM +0900, Masaki Kanno wrote: >> Hi, >> >> When I tested xm new command without uuid parameter repeatedly, >> I saw many same managed domain as follows. >> >> # xm list >> Name ID Mem VCPUs State >> Time(s) >> Domain-0 0 941 2 r----- >> 51.9 >> # xm new /xen/vm1.conf >> Using config file "/xen/vm1.conf". >> # xm new /xen/vm1.conf >> Using config file "/xen/vm1.conf". >> # xm new /xen/vm1.conf >> Using config file "/xen/vm1.conf". >> # xm list >> Name ID Mem VCPUs State >> Time(s) >> Domain-0 0 941 2 r----- >> 56.3 >> vm1 256 1 >> 0.0 >> vm1 256 1 >> 0.0 >> vm1 256 1 >> 0.0 >> >> >> But, when I tested xm new command with uuid parameter repeatedly, >> I did not see same managed domain as follows. >> >> # xm list >> Name ID Mem VCPUs State >> Time(s) >> Domain-0 0 941 2 r----- >> 69.9 >> # xm new /xen/vm1.conf uuid="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" >> Using config file "/xen/vm1.conf". >> # xm new /xen/vm1.conf uuid="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" >> Using config file "/xen/vm1.conf". >> # xm new /xen/vm1.conf uuid="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" >> Using config file "/xen/vm1.conf". >> # xm list >> Name ID Mem VCPUs State >> Time(s) >> Domain-0 0 941 2 r----- >> 74.4 >> vm1 256 1 >> 0.0 >> >> >> I think that xm new command should cause a command error if without >> uuid parameter. What do you think? > >No that would break backwards compatability for user who rely on Xen >autogenerating the UUID. > >In order to maintain back-compatability with existing use cases, the user >needs to be able to update the existing VM config with 'xm new' if the name >or UUID match, while preventing multiple VMs with same name. So the the >rules >when defining a new VM need to follow this logic > > - If the UUID is not specified > - If a VM with same name exists > => Update the config for that existing VM > - Else no vm with same name exists > => Define a brand new VM with auto-generated UUID > - Else UUID is specified > - If a VM with same UUID exists > - If name is different > => Error > - Else if name is same > => Update the config for that existing VM > - Else no VM with same UUID exists > => Define a branch new VM with that name Thanks for your explanation. I have a question to your logic. I think that the logic need a VM name check when no VM with same UUID exists. Am I right? - If the UUID is not specified - If a VM with same name exists => Update the config for that existing VM - Else no vm with same name exists => Define a brand new VM with auto-generated UUID - Else UUID is specified - If a VM with same UUID exists - If name is different => Error - Else if name is same => Update the config for that existing VM - Else no VM with same UUID exists - => Define a branch new VM with that name + - If name is different + => Define a branch new VM with that name + - Else if name is same + => Error Best regards, Kan