How to create instances in BCOS?

Learn how to create instances within BCOS.

Luiz Fernando Justino Silva avatar
Escrito por Luiz Fernando Justino Silva
Updated over a week ago

Instance Creation

  In the previous post How to create and configure a router in BCOS? We provide public access to a network through a router, so we can create the first instance.

  Instance is a virtual machine, being like this, a machine in a virtualized environment where we can allocate operating systems (images) for some purpose.

  To create an instance, go to Project / Compute / Instances click in Launch Instance, type a name for the instance (in the example VM01) and click in Next:

Example:

• Instance Name: VM01.

 Now, in Select boot source select Image, in Create New Volume select No, then choose the image you want to use for the instance (in the Cirros-image example) and click in Next:

Example:

  • Select Boot Source: Image.

  • Create New Volume: No.

  • Image Name: Cirros-Image.

  In Flavor (virtual machine size) select the scaling you need for your instance, then click in Next:

Example:

  • Flavor: BC-1-128-10.

  Keep the network you created earlier and click in the Security Groups tab (optional):

Example:

  • Network: network-production.

 Note: If you do not have a network created, go to How to create a network in BCOS?.

 In this tab you can associate security groups at the time of machine creation, provided they were previously created to allow access to certain network ports, after adding the group click in the Key Pair tab:

 Note: If you do not know how to create a security group go to How to create and join security groups in BCOS?.

Example:

  • Security Group: ALLOW SSH.

  • Security Group:: ALLOW HTTP.

  • Security Group:: ALLOW ICMP.

 At the time of creation you can also add a key pair (previously created) on the machine click on the key you want to add and then go to the Configuration tab (optional):

 Note: If you do not know how to create a key pair, go to How to access instances through key pairs in BCOS?

Example:

  • Key Pair: prod01.

 In this tab you can add a script in the virtual machine at the time of its creation, just add the commands in Customization Script, in the example, will be performed in the instance the installation of apache and inserted a text in the file index.html, done that, click in Launch Instance:

Example:

#!/bin/bash

sudo -i

apt-get install -y apache2

echo 'Apache-VM01' > /var/www/html/index.html

 Okay, the first instance has already been created, now perform some ping tests to verify its operation.

 In Project / Compute / Instances, click in the name of the instance you created to access it, then click in the Console tab and log in to the instance by entering the following username and password:

Example:

  • Login: cirros.

  • Password: “cubswin:)” without the quotes.

 Ping the gateway and external network, then observe the behavior:

Example:

  • Ping to gateway: 192.168.83.1.

  • Ping to external network: 8.8.8.8.

  Note that ping the gateway and external network is working normally.  

  Also check out some features applicable to virtual machines at:
​  How to resize instances in BCOS?.
​  How to lock instances in BCOS?.
​  How to rebuild instances in BCOS?.

Respondeu à sua pergunta?