Difference between revisions of "Red Cloud Linux Instances"
(Changed section "Manage Red Cloud via Linux euca2ools CLI command-line tools" to "Manage Red Cloud via OpenStack CLI" and made blank (for now)) |
(Replaced several occurrences of Eucalyptus with OpenStack, refined language to fit OpenStack, more needed) |
||
Line 2: | Line 2: | ||
− | Linux Instances can be created and maintained on [[Red_Cloud|Red Cloud]] using the [// | + | Linux Instances can be created and maintained on [[Red_Cloud|Red Cloud]] using the [https://redcloud.cac.cornell.edu OpenStack Web Interface]. This documentation assumes a basic understanding of [[OpenStack]], so please review that page as needed. If you are '''new to Linux''', you may want to read the [[Linux Tutorial]] first. It is also a good idea to be familiar with the [[Linux Tutorial]] if you have not previously done '''Linux system administration''', which is an assumed prerequisite to managing Linux Instances. |
__TOC__ | __TOC__ | ||
Line 8: | Line 8: | ||
== Creating a New Linux Instance == | == Creating a New Linux Instance == | ||
− | You can boot an instance with most modern Linux distributions. Currently Red Cloud offers pre-made VM images running the following Linux distributions | + | You can boot an instance with most modern Linux distributions. Currently Red Cloud offers pre-made VM images running the following Linux distributions: |
:* CentOS | :* CentOS | ||
Line 14: | Line 14: | ||
=== Steps === | === Steps === | ||
− | # Log in to the [https:// | + | # Log in to the [https://redcloud.cac.cornell.edu OpenStack Web Interface] (check out [[OpenStack#Logging_In|how to log in]] if you need to) |
# Type "Linux" into filter box, then scroll to the image you want and click Select | # Type "Linux" into filter box, then scroll to the image you want and click Select | ||
# Give the instance a name, choose a CPU/RAM size, click Next | # Give the instance a name, choose a CPU/RAM size, click Next | ||
− | # If you have not already, create a [[ | + | # If you have not already, create a [[OpenStack#Key_Pairs|Key pair]] and select it |
− | # If you have not already, create a [[ | + | # If you have not already, create a [[OpenStack#Security_Groups|Security group]] and select it. Note that your security group should include the inbound SSH rule so you can connect to it. |
− | # '''Optional:''' [[ | + | # '''Optional:''' [[OpenStack#Create_and_Attach_a_Volume|Create and attach a Volume]] |
− | # [[ | + | # [[OpenStack#Launch an Instance|Launch the Instance]] |
Now that you have created and launched an instance, your next steps will be to [[Connect_to_Linux|connect to it]] and set up a new user account. See the [[Linux_Tutorial#Initial_User_Setup_2|CentOS steps]] or [[Linux_Tutorial#Initial_User_Setup|Ubuntu steps]] for more information on how to set up a new user, update, and install software for each distribution. | Now that you have created and launched an instance, your next steps will be to [[Connect_to_Linux|connect to it]] and set up a new user account. See the [[Linux_Tutorial#Initial_User_Setup_2|CentOS steps]] or [[Linux_Tutorial#Initial_User_Setup|Ubuntu steps]] for more information on how to set up a new user, update, and install software for each distribution. | ||
Line 95: | Line 95: | ||
== Initialize and Mount a Volume == | == Initialize and Mount a Volume == | ||
− | The instructions here are for formatting and mounting the ephemeral storage of an instance so it becomes available to you as a temp disk at a typical location. Similar instructions also work for [[ | + | The instructions here are for formatting and mounting the ephemeral storage of an instance so it becomes available to you as a temp disk at a typical location. Similar instructions also work for [[OpenStack#Volumes|attached volumes]], though steps like these can only be performed if you have [[OpenStack#Create_and_Attach_a_Volume|allocated and attached the volume]] through OpenStack, which can be done while the instance is running. |
# Format the disk: | # Format the disk: |
Revision as of 22:16, 9 November 2018
Warning: This page is currently under construction. Information may not be ready for users.
Linux Instances can be created and maintained on Red Cloud using the OpenStack Web Interface. This documentation assumes a basic understanding of OpenStack, so please review that page as needed. If you are new to Linux, you may want to read the Linux Tutorial first. It is also a good idea to be familiar with the Linux Tutorial if you have not previously done Linux system administration, which is an assumed prerequisite to managing Linux Instances.
Creating a New Linux Instance
You can boot an instance with most modern Linux distributions. Currently Red Cloud offers pre-made VM images running the following Linux distributions:
- CentOS
- Ubuntu (including LTS)
Steps
- Log in to the OpenStack Web Interface (check out how to log in if you need to)
- Type "Linux" into filter box, then scroll to the image you want and click Select
- Give the instance a name, choose a CPU/RAM size, click Next
- If you have not already, create a Key pair and select it
- If you have not already, create a Security group and select it. Note that your security group should include the inbound SSH rule so you can connect to it.
- Optional: Create and attach a Volume
- Launch the Instance
Now that you have created and launched an instance, your next steps will be to connect to it and set up a new user account. See the CentOS steps or Ubuntu steps for more information on how to set up a new user, update, and install software for each distribution.
Accessing Instances
There are a few methods to access Linux Instances, which are detailed on the Connect to Linux page. If you are at all unfamiliar with Linux, we recommend following the Linux Tutorial. Additionally, if you would like to have a desktop environment (not available by default for Linux instances), then you may want to follow the steps for XFCE on CentOS.
Note: Transferring files can also be done over ssh
. See the scp
and sftp
commands, or programs like WinSCP and similar software for Mac OS X.
XFCE Desktop on CentOS
In case one would prefer a desktop environment over a command-line, this section details the steps to setting up an XFCE Desktop Environment on a CentOS 7.4 instance. Other typical Linux desktop environments, such as Gnome, are also available but XFCE is used as an example here. Additionally, setting up a desktop environment may work on Ubuntu instances as well, with some differences. Once the environment is set up, you can run a VNC server and connect to it through an ssh tunnel.
XFCE Setup
- Log in as root
- Install needed packages:
yum groupinstall xfce
yum install tigervnc-server
- Install some additional software that most users will want. These are only suggestions, and this is not a comprehensive list
yum install gedit
yum install firefox
- LibreOffice
VNC User Setup
For each user that will want to use the XFCE Desktop, you will need to set up VNC ability. To do this, follow the directions below. Alternatively, there is also an Easy guide to secure VNC server with TLS encryption.
- Open a shell as that user
vncpasswd
- Sets the user's VNC password
- This step is not necessary for read-only VNC
- This creates a ~/.vnc folder
vim ~/.vnc/xstartup
- Paste this text into the file:
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
- Paste this text into the file:
chmod 775 ~/.vnc/xstartup
mkdir ~/bin
vim ~/bin/start_vncserver.sh
- Paste this text into the file:
#!/bin/bash
vncserver -geometry 1680x1050
- Paste this text into the file:
chmod 775 ~/bin/start_vncserver.sh
Using VNC
A brief overview for users is provided here, and for more information please see the Using VNC section on our Getting Started page.
Manage the VNC Server
Whenever an instance gets rebooted, you can restart the VNC server by doing the following
- ssh into the instance
- run
~/bin/start_vncserver.sh
You can stop the NVC server by running vncserver -kill :1
To change or reset the VNC password, you can simply run vncpassword
To change the screen resolution:
- Permanently: edit the script
~/.vnc/xstartup
- For this session only: use Applications->Display
- Permanently: edit the script
View the Desktop
- Open a local shell and ssh to establish the tunnel (recommended local port 10000):
ssh -L 10000:localhost:5901 <remote ip>
- Note: When this shell is closed, the VNC viewer will have to close, too, though VNC is still running.
- In a VNC viewer app, connect to the VNC server
localhost:10000
(or whichever port you chose above).- This should open a window showing the desktop
- The first time you do this:
- For the remote computer, you may have to dismiss a warning dialog
- You will need to initialize a "panel". Click "Use default config"
Note for Windows users: You can also find useful instructions on the VNC Tunnel Windows page. You may also want to look into OpenSSH or Bash on Ubuntu on Windows.
Initialize and Mount a Volume
The instructions here are for formatting and mounting the ephemeral storage of an instance so it becomes available to you as a temp disk at a typical location. Similar instructions also work for attached volumes, though steps like these can only be performed if you have allocated and attached the volume through OpenStack, which can be done while the instance is running.
- Format the disk:
fdisk /dev/vdb
- Enter
n
as a command, then "enter" to accept defaults - Enter
w
to save and quit
- Set up file system
mkfs.ext4 /dev/vdb1
- Make a directory where device will be mounted
mkdir /<diskname>
- Mount the device
mount /dev/vdb1 /scratch
- To have the mount automatically renewed after reboot, add an
fstab
entry (this is a little dangerous)vim /etc/fstab
- Add a line with tab separations between four fields: disk device, mounted location, "ext4", "defaults":
/dev/vdc1 /<diskname> ext4 defaults
Manage Red Cloud via OpenStack CLI
...