Skip to content

Conversation

@nvgoldin
Copy link
Contributor

@nvgoldin nvgoldin commented Jul 1, 2017

  1. Use uuid4 instead of uuid1, so we do not give the same network names in parallel runs.
  2. Let libvirt generate the bridge name - here I think I hit occasionally a race condition in libvirt(one run complains the bridge name already exists, because the other process just created it). According to libvirt docs the bridge name will be auto-generated, however it does not talk directly about parallel-safety. If indeed this an issue, we'll have to generate the bridge name too, which will be little more constrained than the network names because it has a lower limitation on the number of chars(16 iirc).

lago/virt.py Outdated
str: prefixed identifier for the given unprefixed name
str: prefixed identifier for the given unprefixed name, with all
none alphanumeric characters in the unprefixed name replaced
with a 'L'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self - probably better replacing it with a random char.

@nvgoldin nvgoldin force-pushed the uuid4 branch 8 times, most recently from 155429f to 66a3c24 Compare July 26, 2017 13:11
@nvgoldin
Copy link
Contributor Author

ci test please

Until now the prefix uuid was generated with 'uuid1' command. In cases
where you started two environments with the same network names - the uuid1 usage
caused us to pass the same network name to libvirt, despite the environments being
different, thus throwing a libvirt error.

The reason is that we truncated the 8 last bytes of the uuid1 and joined
that with the network name. The 8 last bytes of uuid1 are most
definitely not random.
I see no reason to have the uuid not completely random - therefore this
patch changes the prefix uuid to be generated with uuid4, which should
be completely random.

Signed-off-by: Nadav Goldin <ngoldin@redhat.com>
This patch changes the 'prefixed_name' function logic, so it will
generate unique names, based on the Prefix UUID4 and the SHA256 hash
of the passed name.
This is required as we use those names in passed network names to
libvirt.

Signed-off-by: Nadav Goldin <ngoldin@redhat.com>
Signed-off-by: Nadav Goldin <ngoldin@redhat.com>
Signed-off-by: Nadav Goldin <ngoldin@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant