Get startedGet started for free

Demo: Expand a Subnet

1. Demo: Expand a Subnet

Let me show you how to expand a custom subnet within GCP. I've already created a custom subnet with a slash 29 mask. A slash 29 mask provides you with eight addresses. But of those, four are reserved by GCP, which leaves you with another four for your VM instances. Let's try to create another VM instance in this subnet. So here we are on the GCP console, and I have my four instances, and if I go into the network interface details here, you can see that these are part of a network and I have a subnet here, and if I drilled further into that you can see that I currently have a slash 29. So let's go back and try to create that other instance. Just going to click on Create Instance. I don't need a very large machine, I'm okay with the micro, and let's hit Create. Ideally, we should be getting an error now about the fact that the IP space should have been exhausted, so we're just going to wait for that. You can also follow this along in the notification pane up here and see that it is trying to create that right now. So we're going to wait for that and see if we get an error here in a second. Once we have that, we're going to go ahead and expand the subnet. So here we can see that the instance creation has failed, I can hover over this and it's just telling me that the IP space of that subnet has been exhausted just as expected. We actually have a "Retry" button here as well as a notification pane. We're going to try to use that in a second once we expand the subnet to recreate that instance. Now, what's important is to note that all of these four instances are currently running. So we're not going to take any of these town during the subnet expansion. Now to expand the subnet, I could go to VPC networks through the navigation menu, or I can go back by clicking on nic0 here directly through the network interface details. So the subnet, this is what I want to change, so let me click the "Edit" button, and lets expand this all the way to a slash 23, and this is going to allow a lot of instances, actually over 500 instances. We're going to wait for this to update, and then we're going to head back and try to recreate that instance. So we can also follow this process along right here. It's still saving, so we're going to just hang on tight here. It should just take a couple seconds. All right. We see it's complete. Now, I still have that "Retry" button here to recreate that instance. So let me actually click that, and I can head back to Compute Engine to see if that is going to succeed. So here we are, instance five, it's being staged and will soon begin running. Let's see if this works out. We can see that already has now an internal IP address allocated now that we've expanded the subnet itself, and if I refresh this we can see that the instance is now created. That's how easy it is to expand a subnet in GCP without any workload shutdown or downtime

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.