 10.30 so let's start Hello, nice to see so many ship lovers here today. I am Francesco Giudici. I'm a software engineer at Radettes I'm part of the virtualization team and I work on the Spice project Today I will talk about cloning VMs I would like to start this presentation introducing a superstars Do you know who I'm going to talk about? It's the little ship Basically, she was the first mom that was cloned back in 1996 from another cell It happened at the Rosaline Institute, which is part of the Eddingburg University in Scotland and This was quite interesting because no one at the time told that this was possible And it was not easy at all anyway, so She was the only successful clone from 277 attempts So how the ship cloning works? Basically you take a cell with the desired genes and extract the nucleus Then you take an excel and remove the nucleus You put the two together and you basically get the cell clones put all of this in a surrogate mother and You will likely will fail. We'll have to do that 200 times and maybe you will be lucky, you know What about the VMs? If you have a VM and you want to clone it It's just some other of a double click Well There is any way and not trivial difference between these two processes And as that when you're going to clone a ship you start from an adult ship Take a cell with a DNA, but when with your clone you basically start from scratch You start from the embryo so in the very end you will have a different ship Both in the look and the personality as the environment and the experiences of the clone will be different from the ones of the parents But where are you going to clone a VM? You get an exact copy of that VM including all the configuration and the luck files Everything that is being collected till that time The problem is when you have multiple clones that live in the same environments Each clone needs a unique identity. Otherwise the main transfer with each other in a bad way So what is the environment for a ship? maybe it's a grass and Can you figure out what is the environment for a virtual machine or us? Yeah, you're pretty near. Yeah, it's a P address or more in general the network because it's where the host basically interacts with each other and And In order to identify your host in a network you have to take care of the MAC address first of all Which identifies the network interface card? the AP address for sure be a dynamic or static it should be different and The host name let's look briefly what happens when you clone a virtual machine to each one of this Let's start with the MAC address So here we clone the bank address your virtual machine manager, but any cloning tool It will do basically the same that this will take care of the MAC address for you It will automatically automatically change it So if you want you can put a custom one, but you are not required to this is all set What about the P address if you have a static AP address in true virtual machine and you put down It's your fault. So you can just disparate like this Lego guy I expect you to take care of it Changing the static AP address on the other virtual machine Just for reference if you use network manager, you can do that quite easily with MCI Command tool and change it before addresses with property But what if you have a dynamic AP address there? You might think that okay I don't have to care to take care of that because it will be the DCP server that is in charge to Assigning a different IP address to each one of the clones well, that's somehow true, but it's a bit more complex than this because The DCP server will identify the host from its DCP requests And in particular it will look for the CP for to this DCP client in the option That should contain a unique identifier as the Standard says it must be unique amount in the client identifier used on the subnet to which the client is attached So we must ensure that different clones will have different DCP clients ID Regarding DCP v6. It's a little bit different in the sense that the binding of the address assigned by the CP server will be to a couple of options one is the DCP unique ID option that will identify the host which is basically a UID that should be unique on the network and Then the identity association identifier option with which will identify a specific Interface on that host Again just for reference if you use a network manager. Yeah, I like a network manager if you aren't understood that You will have to change you can change it to different option that is IPv4 DCP client D or IPv6 DCP D UID It will allow you to explicitly sell them you can have more details on these looking at a month page of nm settings What about the host name it is important because usually it is sets In it is sent in DCP request from the client and we use it by the DCP server to To Be registered in the local DNS system If you have two virtual machines sending the same host name to the CP server you end up just having the last one You usually send in the the last DCP request to win Okay, to change this there are a couple of examples here We're using us name CDL and network manager on us again. There are a lot of ways there I link a dear Blockpost from set count that shows you some ways to change your host name in the system Now something that is a bit unrelated in general to networking, but it's more specific to the guest operating system and It is the machine ID file As I said, this is just for Linux what we have seen till now in style was for every kind of operating systems or windows Mac units, whatever But in Linux we have this file that as its month state Uniquely identifies the host it should be considered confidential this means that we want a different virtual machine will have different machine ID and And this is not something that when you clone a virtual machine is automatically taken care of You can change it just Removing the machine ID file and regenerating one with system D machine ID setup or the bus you the jam tools But I will warn you don't play too much with this pay attention because It's better that as soon as you change it you reboot your virtual machine and you You should really ensure that you have a valid machine ID before rebooting the host. Otherwise, you may even have issues about it This machine ID configuration file it is used to derive all the unique identifiers that application might need in order to To communicate also with other host so why doesn't sport and we'll see it right now we had an Example of what really can't go wrong. This is taken from something that happened for real You can reproduce the scenario. It's easy, but yeah, it happens Also when one doesn't want that this kind of stuff happens What is the scenario you have a virtual machine that is configured in this case with system? you know today and This is this is configured to get the IP address by this IP server You do multiple clones of that and you start the clones in the same network without doing any special configuration As we have seen the Mac is taken care The Mac is kept is taken care by the cloning tool. So That's okay, but what about the DSP client ID the Austin in the machine ID? No one takes care by default. You don't know what will happen. So there is not check on this So the result will be that the parvian and the clones will experience a very connectivity disruption and Let's see why this happens. What are the details? Let's dig a bit a bit more in the standard for DCP before there is an extension to the standard that tries to put together how the binding of an IP address and I need into far sent to the DCP server our math The idea is to use to reuse what is done in the DCP v6 that is Have an option for the Austin for the for identifying the host the DU ID and an option to identify an interface and use This also in the DCP for client ID in a very easy way Basically, you can concatenate down and put in the DCP client ID option as you can see the first four bytes Are the one of the AI ID and the other ones are from the DU ID? So system D network D Uses this extension and what it does well in order to generate an identifier for the Identity Association ID that is to map the interface in the host it will use a function that is based on interface name Unluckily in your VM clones the interface name will be the same also if you change your network address Regarding the DU ID System in a torque they will do as much as my thing that is I will use something that is Guaranteed to be unique in the host and we've seen that for Linux host The configuration of a unique identifier is there in the machine ID file. So it will use a function of the machine ID as We have already already said the machine ID is not changed Automatically when you are going to do a clone of your virtual machine So the result will be that when the first virtual machine starts It will send a DCP client ID Constructed like we have just seen This server will be a reply offering an IP address in this case the dot 38 one When a clone starts It will send the same DCP client ID and the DCP server will be full at thinking It's the same machine and we reply with the same IP address So you will end up having on the same network chew it on machine with the C or the same IP address And what you expect to happen? No internet connection or severely disrupted connectivity why? because when host tries to To reach out one of the VMs Maybe it's just a gateway that tries to reply to some requests from from one of the VM. It will try first of all to resolve the DPR to map the IP address with the Mac address of the return machine he has to reach out But when he does this it will reply Multiple it will get multiple replies for each one of the virtual machine. So it would be a lot of Mac addresses it will pick one but More virtual machine you are more likely it will pick up the wrong one. So What's the right way to clone a virtual machine? First of all, we have to clone the virtual machine as we are seeing them from the beginning using virtual machine manager or in this case I use the virtual weird clone to that is basically on one liner allowing to do the same job as we have seen The Mac address is already okay There are multiple options here It's not that that complicated if you are interested to really have maybe your specific name of your clone or Where to put your clone at the disk you you could just check them each of it and Then what you have to do is to do as it was a ship We've seen at the beginning that when you clone a ship it start basically from scratch being able to have his own experience his own his own development and Indivian this does not does not happen. So How can you do the same basically have a copy of a machine clone that could have his own configuration or Identity Well, just the configuring or reconfiguring it as needed So that he could start somehow from scratch and develop his own identity You do that Easily with a tool that is vertices prep. It allows you to prepare your virtual machine before booting and It is as easy as launching it by passing minus D that stands for the main and the name of your virtual machine In this example, I also pass it there an optional Parameter that is us name so I can change also the us name But if you just run it it will take care of a lot of stuff like first of all changing the machine ID removing DCP leases Really other stuff done automatically It can do also some other useful stuff like for instance Removing user accounts if you don't need that or changing their password. Yeah, there are really a lot of usable features You can find all of them in the manual of it name and page of it So they come to the summary We are seeing that when you want to clone a virtual machine is pretty easy It could be just some other or double-click or using one liner But maybe it's not that easy to have them running by side-by-side Because each clone does not have a unique identity by default We should really ensure the network identity that is especially taking care of the p address I might be of the hostname if it is set But to do this or you configure your virtual machine by hand or you can use also an handy tool That is the vertices prep. It'll allow you you to the configure or reconfigure your host That's it Any question are good also question about Dolly and the ship if you want Yes, please The chain And those are pretty safe operations We also clean the machine That's more Or So So just for the recording the question was about what kind of File system are supported another is Every every file system that is supported by you links also basically any other question Do you like ship? Have you heard about Dolly in a person when I think yeah, of course Okay, I will not just yeah, please no the question. Okay, so the question is I Had the impression that GCP would assign a P address base is gonna on the Mac address What what we cover in this presentation seems to say something different well What the CP server does is basically Will map the same IP address yeah to a Mac address, but it will it will identify the host By a different option which is the that the dcp ID option I would say explain a bit why this happened is that Imagine you have your host and You're going to change your network card. You will change your Mac address, right? So when you send out the your dcp request of a rebooting If you we use the same dcp client ID The the dcp server will understand that you are the same host also if you change it in your Mac address And it will be able to give you the same IP address That's the main point. This is why Another thing that I didn't said is that usually the dcp client ID is derived from the Mac address Also to deal with this cloning via stuff if it's not done, let's say properly At least we ensure that the Mac address is changed with a cloning tool So it'll work usually if you use for instance network manager right now And you do your clone you don't change the machine ID You will get different IP addresses I take the example of system in a truly because they do by default different and I think they do right there are areas that we don't change the machine ID So anyway, sorry, I went a bit too far away, but the answer is there is another option to control How to be identified by the dcp server because you may change the the network interface card of your host And you want anyway to get the same IP address and have the dcp server to recognize you Yeah, for dcp4 the option is option 61 The question okay, the question is which guest operating system I've supported by this birth see spread I Guess it is just news right now, but but there are windows also that is going to be supported at some point So just for the recording was again The question was which kind of party system are supported and there was a good question a good reply from Pinot's can and it is that basically all the news flavors Probably all all of them also Unix up in some parts windows is not yet supported For in those anyway, there is the c-spread tool from Microsoft that could be something More specific to Windows if you're interested into okay, we are out of time So thank you for to be