Skip to contentSkip to conversation

Many same managed domain

DISCUSSION Masaki Kanno 4 participants 12 messages Jul 22, 2007 – Jul 26, 2007 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

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?

Best regards,
Kan

#1 lore raw
Quoted 40 lines · Masaki Kanno

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
Quoted 2 lines

I think that xm new command should cause a command error if without uuid parameter. What do you think?

Either that, or check that the name isn't a duplicate - I added such a check for "xm create" and "xm restore" about two months ago, because it would allow multiple instances of the same domain (with the same UUID - something I never got to the bottom of).

--
Mats

Quoted 9 lines

Best regards,
Kan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
In reply to Masaki Kanno
Quoted 40 lines · Masaki Kanno

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
Quoted 2 lines

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

Depending on where in the XenD code you put this error checking you may need some extra special case rules handle stuff like localhost migration.

Regards,
Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#4 lore raw
Quoted 78 lines · Daniel P. Berrange
Quoted 7 lines · Masaki Kanno

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)

Quoted 1 line

Domain-0 0 941 2 r----- 51.9

Quoted 8 lines
# 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)

Quoted 1 line

Domain-0 0 941 2 r----- 56.3

Quoted 1 line

vm1 256 1 0.0

Quoted 1 line

vm1 256 1 0.0

Quoted 1 line

vm1 256 1 0.0

Quoted 7 lines

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)

Quoted 1 line

Domain-0 0 941 2 r----- 69.9

Quoted 8 lines
# 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)

Quoted 1 line

Domain-0 0 941 2 r----- 74.4

Quoted 1 line

vm1 256 1 0.0

Quoted 4 lines

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

Quoted 2 lines

Depending on where in the XenD code you put this error checking you may need some extra special case rules handle stuff like localhost migration.

With live migration/save&restore, you shouldn't need to worry about the name [1], but obviously, the UUID should be the same for the new and old migrated domain, and live migration should be allowed to "localhost".

[1] Part of "xm save/migrate" is to prepend "migrating" to the name of the domain, so there should be no name conflict with live migration when the new domain is created.

--
Mats

Quoted 12 lines

Regards,
Dan.
--

|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=|

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
In reply to Mats Petersson
Quoted 54 lines
Quoted 52 lines · Masaki Kanno

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
Quoted 8 lines
Quoted 2 lines

I think that xm new command should cause a command error if without uuid parameter. What do you think?

Either that, or check that the name isn't a duplicate - I added such a check for "xm create" and "xm restore" about two months ago, because it would allow multiple instances of the same domain (with the same UUID - something I never got to the bottom of).

Thanks for your opinion.
Your patch is changeset 15168, isn't it?

Best regards,
Kan

#5 lore raw
In reply to Daniel P. Berrange
Quoted 66 lines · Masaki Kanno
Quoted 52 lines

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
Quoted 2 lines

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

Quoted 13 lines

- 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

#6 lore raw
Quoted 42 lines · Masaki Kanno
Quoted 12 lines · Masaki Kanno

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

Quoted 13 lines

- 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

Review

Quoted 5 lines
(quoted diff) +4 -1
-           => 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

Yes you are correct - if UUID does not clash we still need to check for a VM with same name, but different UUID.

Dan,

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#7 lore raw
Quoted 50 lines · Masaki Kanno
Quoted 43 lines
Quoted 13 lines · Masaki Kanno

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

Quoted 13 lines

- 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

Review

Quoted 5 lines
(quoted diff) +4 -1
-           => 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
Quoted 2 lines

Yes you are correct - if UUID does not clash we still need to check for a VM with same name, but different UUID.

Thanks for your reply.
I will write a patch based on the logic.

Best regards,
Kan

#10 lore raw
In reply to a message not in the archive

Daniel Berrange wrote:
[snip]

Quoted 23 lines
Quoted 17 lines

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

Review

Quoted 5 lines
(quoted diff) +4 -1
-           => 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
Quoted 3 lines

Yes you are correct - if UUID does not clash we still need to check for a VM with same name, but different UUID.

As a side note, Xen API allows for domains with same name - in spec at least :-).

((VM ref) Set) VM.get_by_name_label (session_id s, string label) Return Type: (VM ref) Set
references to objects with match names

Jim

#11 lore raw
Quoted 25 lines

Daniel Berrange wrote:
[snip]

Quoted 23 lines
Quoted 22 lines

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

(quoted diff) +4 -1
-           => 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
Quoted 6 lines
Quoted 3 lines

Yes you are correct - if UUID does not clash we still need to check for a VM with same name, but different UUID.

As a side note, Xen API allows for domains with same name - in spec at least :-).

Hmm..... What should I do?

Thanks,
Kan

#12 lore raw
In reply to Jim Fehlig
Quoted 25 lines · Jim Fehlig

Daniel Berrange wrote:
[snip]

Quoted 23 lines
Quoted 22 lines

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

(quoted diff) +4 -1
-           => 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
Quoted 6 lines
Quoted 3 lines

Yes you are correct - if UUID does not clash we still need to check for a VM with same name, but different UUID.

As a side note, Xen API allows for domains with same name - in spec at least :-).

That is madness. Name uniqueness is assumed in pretty much every single management tool I've ever seen, not least 'xm'. ID is unique amongst all running domains, Name is unique amongst running and inactive guests on a single host, UUID is unique globsally.

Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#13 lore raw
In reply to Jim Fehlig
Quoted 32 lines · Daniel P. Berrange
Quoted 30 lines · Jim Fehlig

Daniel Berrange wrote:
[snip]

Quoted 27 lines
Quoted 18 lines

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

Review

Quoted 5 lines
(quoted diff) +4 -1
-           => 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

Yes you are correct - if UUID does not clash we still need to check for a VM with same name, but different UUID.

Quoted 9 lines
Quoted 3 lines

As a side note, Xen API allows for domains with same name - in spec at least :-).

That is madness. Name uniqueness is assumed in pretty much every single management tool I've ever seen, not least 'xm'. ID is unique amongst all running domains, Name is unique amongst running and inactive guests on a single host, UUID is unique globsally.

Well, I agree and thought there was some discussion about this on Xen API ml quite some time ago but looking through the archives can't seem to find it. I do not recall what arguments were made in favor of domains with same name. Ewan may have some recollection.

Given the current consensus, I should submit a patch to fix Xen API documentation and code and put this to rest for good. Any objections?

Jim