87 lines
12 KiB
Markdown
87 lines
12 KiB
Markdown
---
|
|
sidebar_label: "Launch and manage instances"
|
|
sidebar_position: 1
|
|
---
|
|
|
|
<!-- truncate -->
|
|
|
|
import CodeBlock from '@site/src/components/CodeBloack';
|
|
import launchinstance from '@site/static/img/launch-instance.png';
|
|
import sourcetab from '@site/static/img/source-tab.png';
|
|
import flavor from '@site/static/img/flavor.png';
|
|
import network from '@site/static/img/network.png';
|
|
import networkport from '@site/static/img/network-port.png';
|
|
import securitygroup from '@site/static/img/security-group.png';
|
|
import keypair from '@site/static/img/key-pair2.png';
|
|
import configuration from '@site/static/img/configuration.png';
|
|
|
|
# Launch and manage instances
|
|
|
|
<div className="text">Instances are virtual machines that run inside the cloud. You can launch an instance from the following sources: <ul><li>Images uploaded to the Image service.
|
|
</li><li>Image that you have copied to a persistent volume.</li><li>Instance snapshot that you took.</li></ul></div>
|
|
|
|
<div className="head">Launch an instance</div>
|
|
|
|
<div className="text"><ol><li>Log in to the dashboard.</li><li>Select the appropriate project from the drop down menu at the top left.
|
|
</li><li>On the <span className="blue">Project</span> tab, open the <span className="blue">Compute</span> tab and click <span className="blue">Instances</span> category.<br/>
|
|
The dashboard shows the instances with its name, its private and floating IP addresses, size, status, task, power state, and so on.</li><li>Click <span className="blue">Launch Instance</span>.</li><li>In the <span className="blue">Launch Instance</span> dialog box, specify the following values:<br/>
|
|
<span className="blue">Details</span> tab<br/><br/>
|
|
<img src={launchinstance} alt="Launch Instance" /><strong>Instance Name</strong><br/>Assign a name to the virtual machine.<br/><div className="note"><strong>Note:</strong> The name you assign here becomes the initial host name of the server. If the name is longer than 63 characters, the Compute service truncates it automatically to ensure dnsmasq works correctly.<br/>After the server is built, if you change the server name in the API or change the host name directly, the names are not updated in the dashboard.<br/>Server names are not guaranteed to be unique when created so you could have two instances with the same host name.</div><br/><strong>Description</strong><br/>You can assign a brief description of the virtual machine.<br/><strong>Availability Zone</strong><br/>By default, this value is set to the availability zone given by the cloud provider (for example, us-west or apac-south). For some cases, it could be nova.<br/><strong>Count</strong><br/>To launch multiple instances, enter a value greater than 1. The default is<br/> 1.
|
|
<span className="blue">Source</span> tab<br/><strong>Instance Boot Source</strong><br/>Your options are:<br/><br/><strong>Boot from image</strong></li>If you choose this option, a new field for <span className="blue">Image Name</span> displays. You can select the image from the list.<br/><strong>Boot from snapshot</strong><br/>If you choose this option, a new field for <span className="blue">Instance Snapshot</span> displays. You can select the snapshot from the list.<br/><strong>Boot from volume</strong><br/>If you choose this option, a new field for <span className="blue">Volume</span> displays. You can select the volume from the list.<br/><strong>Boot from image (creates a new volume)</strong><br/>With this option, you can boot from an image and create a volume by entering the <span className="blue">Device Size</span> and <span className="blue">Device Name</span> for your volume. Click the <span className="blue">Delete Volume on Instance Delete</span> option to delete the volume on deleting the instance.<br/><strong>Boot from volume snapshot (creates a new volume)</strong><br/>Using this option, you can boot from a volume snapshot and create a new volume by choosing <span className="blue">Volume Snapshot</span> from a list and adding a <span className="blue">Device Name</span> for your volume. Click the <span className="blue">Delete Volume on Instance Delete</span> option to delete the volume on deleting the instance.<br/><strong>Image Name</strong><br/>This field changes based on your previous selection. If you have chosen to launch an instance using an image, the <span className="blue">Image Name</span> field displays. Select the image name from the dropdown list.<br/><strong>Instance Snapshot</strong><br/>This field changes based on your previous selection. If you have chosen to launch an instance using a snapshot, the <span className="blue">Instance Snapshot</span> field displays. Select the snapshot name from the dropdown list.<br/><strong>Volume</strong><br/>This field changes based on your previous selection. If you have chosen to launch an instance using a volume, the <span className="blue">Volume</span> field displays. Select the volume name from the dropdown list. If you want to delete the volume on instance delete, check the <span className="blue">Delete Volume on Instance Delete</span> option.<br/><br/><img src={sourcetab} alt="Source Tab" /><br/><br/>
|
|
<span className="blue">Flavor</span> tab<br/><strong>Flavor</strong><br/>Specify the size of the instance to launch.<br/><div className="note"><strong>Note</strong>: The flavor is selected based on the size of the image selected for launching an instance. For example, while creating an image, if you have entered the value in the Minimum RAM (MB) field as 2048, then on selecting the image, the default flavor is m1.small.</div><br/><img src={flavor} alt="Flavor" /><br/><br/>
|
|
<span className="blue">Networks </span>tab<br/><strong>Selected Networks</strong><br/>To add a network to the instance, click the + in the Available field.<br/><img src={network} alt="Network" /><br/><br/><span className="blue">Network Ports</span> tab<br/><strong>Ports</strong><br/>Activate the ports that you want to assign to the instance.<br/> <img src={networkport} alt="Network Port" /><br/><br/>
|
|
<span className="blue">Security Groups</span> tab<br/><strong>Security Groups</strong><br/>Activate the security groups that you want to assign to the instance.<br/>
|
|
Security groups are a kind of cloud firewall that define which incoming network traffic is forwarded to instances.<br/>If you have not created any security groups, you can assign only the default security group to the instance.<br/><img src={securitygroup} alt="Security Group" /><br/><br/><span className="blue">Key Pair </span>tab<br/><strong>Key Pair</strong><br/>Specify a key pair.<br/>If the image uses a static root password or a static key set (neither is recommended), you do not need to provide a key pair to launch the instance.<br/><img src={keypair} alt="Key Pair" /><br/><br/><span className="blue">Configuration</span> tab<br/><strong>Customization Script Source</strong><br/>Specify a customization script that runs after your instance launches.<br/><img src={keypair} alt="Key Pair" /><br/><br/><span className="blue">Metadata </span>tab<br/><strong>Available Metadata
|
|
</strong><br/>Add Metadata items to your instance.<li>Click <span className="blue">Launch Instance.</span><br/>The instance starts on a compute node in the cloud.</li></ol></div>
|
|
|
|
<div className="note"><strong>Note</strong>: If you did not provide a key pair, security groups, or rules, users can access the instance only from inside the cloud through VNC. Even pinging the instance is not possible without an ICMP rule configured.</div>
|
|
|
|
<div className="text">You can also launch an instance from the <span className="blue">Images</span> or <span className="blue">Volumes</span> category when you launch an instance from an image or a volume respectively.</div>
|
|
|
|
<div className="text">When you launch an instance from an image, OpenStack creates a local copy of the image on the compute node where the instance starts.</div>
|
|
|
|
<div className="text">For details on creating images, see <span style={{textDecoration:'underline', color: '#0000b3'}}>Creating images manually</span> in the OpenStack Virtual Machine Image Guide.</div>
|
|
|
|
<div className="text">When you launch an instance from a volume, note the following steps:</div>
|
|
|
|
<div className="text"><ul><li>To select the volume from which to launch, launch an instance from an arbitrary image on the volume. The arbitrary image that you select does not boot. Instead, it is replaced by the image on the volume that you choose in the next steps.
|
|
To boot a Xen image from a volume, the image you launch in must be the same type, fully<br/>virtualized or paravirtualized, as the one on the volume</li><li>Select the volume or volume snapshot from which to boot. Enter a device name. Enter vda for KVM images or xvda for Xen images.</li></ul></div>
|
|
|
|
<div className="note"><strong>Note</strong>: When running QEMU without support for the hardware virtualization, set cpu_mode="none" alongside virt_type=qemu in /etc/nova/nova-compute.conf to solve the following error:</div>
|
|
|
|
<CodeBlock code={`libvirtError: unsupported configuration: CPU mode 'host-model'
|
|
for 'x86_64' qemu domain on 'x86_64' host is not supported by hypervisor
|
|
`} />
|
|
|
|
<div className="head">Connect to your instance by using SSH</div>
|
|
|
|
<div className="text">To use SSH to connect to your instance, use the downloaded keypair file.</div>
|
|
<div className="note"><strong>Note</strong>: The user name is ubuntu for the Ubuntu cloud images on TryStack.</div>
|
|
|
|
<div className="text">1. Copy the IP address for your instance.</div>
|
|
<div className="text">Use the ssh command to make a secure connection to the instance. For example:</div>
|
|
|
|
<CodeBlock code={`$ ssh -i MyKey.pem ubuntu@10.0.0.2
|
|
`} />
|
|
|
|
<div className="text">2.At the prompt, type yes. </div>
|
|
|
|
<div className="text">It is also possible to SSH into an instance without an SSH keypair, if the administrator has enabled root password injection. For more information about root password injection, see <span style={{textDecoration:'underline', color: '#0000b3'}}>Injecting the administrator password</span> in the OpenStack Administrator Guide.</div>
|
|
|
|
<div className="head">Track usage for instances</div>
|
|
|
|
<div className="text">You can track usage for instances for each project. You can track costs per month by showing meters like number of vCPUs, disks, RAM, and uptime for all your instances.</div>
|
|
|
|
<div className="text"><ol><li>Log in to the dashboard.</li><li>Select the appropriate project from the drop down menu at the top left.</li><li>On the <span className="blue">Project</span> tab, open the <span className="blue">Compute</span> tab and click <span className="blue">Overview</span> category.</li><li>To query the instance usage for a month, select a month and click <span className="blue">Submit</span>.</li><li>To download a summary, click <span className="blue">Download CSV Summary</span>.</li></ol></div>
|
|
|
|
<div className="head">Create an instance snapshot</div>
|
|
|
|
<div className="text"><ol><li>Log in to the dashboard.</li><li>Select the appropriate project from the drop down menu at the top left.</li><li>On the <span className="blue">Project</span> tab, open the <span className="blue">Compute</span> tab and click the Instances category.</li><li>Select the instance from which to create a snapshot.</li><li>In the actions column, click <span className="blue">Create Snapshot</span>.</li><li>In the <span className="blue">Create Snapshot</span> dialog box, enter a name for the snapshot, and click <span className="blue">Create Snapshot</span>.<br/>The <span className="blue">Images</span> category shows the instance snapshot.</li></ol></div>
|
|
|
|
<div className="text">To launch an instance from the snapshot, select the snapshot and click <span className="blue">Launch</span>. Proceed with launching an instance.</div>
|
|
|
|
<div className="head">Manage an instance</div>
|
|
|
|
<div className="text"><ol><li>Log in to the dashboard.</li><li>Select the appropriate project from the drop down menu at the top left.</li><li>On the <span className="blue">Project</span> tab, open the <span className="blue">Compute</span> tab and click <span className="blue">Instances</span> category.</li><li>Select an instance.</li><li>In the menu list in the actions column, select the state.
|
|
You can resize or rebuild an instance. You can also choose to view the instance console log, edit instance or the security groups. Depending on the current state of the instance, you can pause, resume, suspend, soft or hard reboot, or terminate it.</li></ol></div>
|