User Tools

Site Tools


cloud:cli

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
cloud:cli [2020/05/14 09:36] – created chudlercloud:cli [2020/05/14 09:52] chudler
Line 1: Line 1:
-===== CLI ACCESS =====+===== CLOUD CLI ACCESS =====
  
 == INSTALL == == INSTALL ==
-It is installable in many ways. +Pip is preferred. The general CS infrastructure is good starting point. However, our experience has been that the software installs cleanly and is free from dependency problems.
- +
-Use your favorite package manager on your own computer. Pip is preferred because the upstream packages it for themselves and it is in pure python. The general CS infrastructure will become managed client for you to use in the near future (e.g., linux.cs.uchicago.edu). However, our experience has been that the software installs cleanly and is free from dependency problems.+
  
 Try: <code>python3 -m pip install --user python-openstackclient</code> Try: <code>python3 -m pip install --user python-openstackclient</code>
  
-== PRELIMINARY SETUP ==+===== CONFIGURATION =====
  
-Use environment variables to direct your client. Below is a canonical example, but you __will__ have to modify the variables according to your account.+Use a clouds.yaml file to direct your client. Below is a canonical example, but you __will__ have to modify the variables according to your account. 
 +''$HOME/.config/clouds.yaml''
 <code> <code>
-# Clear any old environment that may conflict. +clouds: 
-for key in $( set | awk '{FS="=" /^OS_/ {print $1}' ); do unset $key ; done +  openstack: 
-export OS_NO_CACHE=True +    auth: 
-export COMPUTE_API_VERSION=1.1 +      auth_url: https://overcloud.cs.uchicago.edu:5000 
-export OS_USERNAME=chudler +      username: "CNetID" 
-export no_proxy=overcloud.cs.uchicago.edu +      password: "sekret" 
-export OS_REGION_NAME=regionOne +      project_id: YOUR PROJECT UUID 
-export OS_USER_DOMAIN_NAME=Default +      project_name: "CNetID" 
-export OS_VOLUME_API_VERSION=3 +      user_domain_name: "CS_LDAP" 
-export OS_CLOUDNAME=overcloud +    region_name: "RegionOne" 
-export OS_AUTH_URL=https://overcloud.cs.uchicago.edu:13000 +    interface"public
-export NOVA_VERSION=1.1 +    identity_api_version: 3
-export OS_IMAGE_API_VERSION=2 +
-export OS_PASSWORD=sekret +
-export OS_PROJECT_DOMAIN_NAME=Default +
-export OS_IDENTITY_API_VERSION=3 +
-export OS_PROJECT_NAME=chudler +
-export OS_AUTH_TYPE=password +
-export PYTHONWARNINGS="ignore:Certificate has no, ignore:A true SSLContext object is not available+
-export OS_COMPUTE_API_VERSION=2.latest+
 </code> </code>
 +The [[ cloud:recipe:coding | Python Examples ]] use the same configuration, please read that document for detailed information about configuration and recommendations.
  
-You can also download a customized version of this data after you authenticate to the Web Interface (click API Access from the menu and then the button "Download Openstackrc File"). Make sure you read this file carefully in case you want to customize it.+You can also download a customized version of this data after you authenticate to the Web Interface (click API Access from the menu and then the button "Download Openstackrc File"). Make sure you read this file carefully in case you want to customize it. Your password is not included in the file by default.
  
-== USAGE ==+====== USAGE ======
  
 First, Take note of a loose UX pattern that the client has: First, Take note of a loose UX pattern that the client has:
Line 47: Line 39:
 For example<code>openstack server create --help</code> For example<code>openstack server create --help</code>
  
-Once you have the software installed and the shell's environment populated as above, you can start to use the client. What follows is an annotated example that will create an infrastructure of 10 Ubuntu hosts accessing the internet via a NAT device (SNAT), and with one of the hosts reachable at a separate pubic IP address (DNAT).+Once you have the software installed and the configuration file created, as above, you can start to use the client. What follows is an annotated example that will create an infrastructure of 10 Ubuntu hosts accessing the internet via a NAT device (SNAT), and with one of the hosts reachable at a separate pubic IP address (DNAT).
  
-==== Annotated Example ====+====== Annotated Example ======
 Read what has been written above before you read this. Read what has been written above before you read this.
  
-Look around. The list could be empty, but we use this command a lot!+We use this command a lot
 <code>openstack server list</code> <code>openstack server list</code>
 +
 +====Images====
  
 Images are prebuilt disks that are used to launch instances. They are usually a few GB in size. A copy of the disk image is written into the instance's boot volume just before it starts running. Images are prebuilt disks that are used to launch instances. They are usually a few GB in size. A copy of the disk image is written into the instance's boot volume just before it starts running.
 +
 There are images that Techstaff provides, some of which are restricted-use. We can build images for you or you can build and upload your own. Our images are generic, bare bones, cloud enabled popular operating systems that are a firm foundation for you to customize from. They are often in RAW format, not qcow2, for performance reasons. There are images that Techstaff provides, some of which are restricted-use. We can build images for you or you can build and upload your own. Our images are generic, bare bones, cloud enabled popular operating systems that are a firm foundation for you to customize from. They are often in RAW format, not qcow2, for performance reasons.
 +
 <code>openstack image list</code> <code>openstack image list</code>
  
-Openstack can hold a public key in its db, and insert it into instances when told. This is optional (your author does not use this)+====SSH Keys==== 
 + 
 +Openstack can hold a public key in its db, and insert it into instances when told. This is optional (your author does not use this capability)
 <code>openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey</code> <code>openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey</code>
  
-A flavor is a pre-chosen size for resources that make up an instance. It is a mandatory parameter when creating instances. Look at the available flavors ,which your admins have created.\\ +==== Flavors ==== 
-Servers can grow after creation. For example, the disk-size attribute merely expresses the **minimum** size of the boot volume, and most cloud-enabled operating systems expand the root volume on first-boot. In spite of this, relying on dynamically resizing instances increases risk, and it is far better to size them correctly when they are built.+A flavor is a pre-chosen size for resources that make up an instance. It is a mandatory parameter when creating instances. Look at the available flavors, which your admins have created.\\ 
 +Servers can grow after creation. For example, the disk-size attribute merely expresses the **minimum** size of the boot volume, and most cloud-enabled operating systems expand the root volume on first-boot. In spite of this, relying on dynamically resizing instances increases risk, and you should choose a size that is close to what you expect to use.
 <code>openstack flavor list</code> <code>openstack flavor list</code>
  
-Look at the Networks that are available (an Openstack "Network" captures L2 semantics, and houses L3 subnets)FYI: As of 6DEC19we have not tested IPv6 for instances.+==== Networks ===== 
 +Look at the Networks that are available. The meaning of an Openstack "Network" captures L2 semantics, and houses L3 subnets. IPv6 is in preview mode at this timeand is not fully supported on the UC campus. 
 + 
 +You are free to use the Network called __cloud__, if you don't need your hosts to be L2 isolated from other users, and you would like to proceed directly to creating servers.
  
-You are free to use the Network called __cloud__, if you don't need your hosts to be L2 isolated from other people, and you would like to proceed directly to creating servers. 
 Using the __cloud__ network cuts down your complexity significantly, and can be changed later, or mixed with other modes at your leisure. Please talk with us if you want to attach a Router to the __cloud__ network. Using the __cloud__ network cuts down your complexity significantly, and can be changed later, or mixed with other modes at your leisure. Please talk with us if you want to attach a Router to the __cloud__ network.
  
/var/lib/dokuwiki/data/pages/cloud/cli.txt · Last modified: 2021/04/15 16:53 by chudler

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki