User Tools

Site Tools


cloud:intro

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
cloud:intro [2019/12/06 14:26] chudlercloud:intro [2020/05/14 09:23] – trim text chudler
Line 1: Line 1:
 === SCOPE OF THIS DOCUMENT === === SCOPE OF THIS DOCUMENT ===
  
-This guide will cover a common subset of tasks that a user would need to perform to have a set of clustered computer instances and associated resources, isolated from others, and accessible to a project for any general purpose, both long-term and short. We are catering heavily to short-term usage, perhaps lasting a few quarters.+This guide covers the common subset of tasks that users would need to perform to have a set of clustered computer instances and associated resources, isolated from others, and accessible to a project for any general purpose, both long-term and short.
  
-Some things that are not here but perhaps should be covered elsewhere 
- 
-  * Theory of operations (everything is by example) 
-  * Tasks accomplished from the Web Interface 
-  * Background and History 
-  * Organizational Policy, such as who can do what. 
-  * Deployment Architecture 
-  * Limitations 
-  * User management, Group management, and similar concepts 
-  * Good Practices (because they are nascent, at best) 
-  * Cloud init, Fog, Terraform, Heat, and other operational tools 
-  * Security 
-  * Backup and Restore 
- 
-The list is not comprehensive. 
  
 === A WORD ABOUT SECURITY === === A WORD ABOUT SECURITY ===
  
-The security of the virtual computers that you launch is __your responsibility__. With this software you are able to create wildly insecure configurations that will be hacked within seconds, with no hope of recovering. This can put all of us at risk. The highest risk that you will encounter is to expose your computers to the Internet. Beware of the dangers associated with doing so!+The security of the virtual computers that you launch is __your responsibility__. With this software you are able to create insecure configurations that will be hacked, with no hope of recovering. This can put all of us at risk. The highest risk that you will encounter is to expose your computers to the Internet. Beware of the dangers associated with doing so!
  
  
 === INTRODUCTION AND NOTES === === INTRODUCTION AND NOTES ===
  
-This cluster can spring into being computer resources, easily, and without any involvement of other personnel. The software has some exotic capabilities, but almost everyone will use this common subset:+This cluster can spring into being computer resources without the involvement of other personnel. The software has some exotic capabilities, but this is a common subset:
  
   * L2 and L3 Network   * L2 and L3 Network
   * Router (SNAT and DNAT devices, etc)   * Router (SNAT and DNAT devices, etc)
   * Compute, and all that it entails such as RAM, CPU, Disk, ...   * Compute, and all that it entails such as RAM, CPU, Disk, ...
-  * Block Storage (volume mounts)+  * Additional Block Storage (volume mounts)
   * Security groups (firewall service)   * Security groups (firewall service)
  
-Some want 
-  * Distributed/Replicated hash tables (K/V store, Object Storage) 
  
-The cloud can also manage resources on your behalf that are traditionally handled by a human operator. This is less common, and amounts to cognitive debt that you may eventually have to pay:+The cloud can also manage resources on your behalf that are traditionally handled by a human operator:
  
   * Load balancer   * Load balancer
   * NFS   * NFS
-  * Rancher Kubernetes (among others)+  * Hadoop 
 +  * Rancher Kubernetes 
 +  * Container Runtime
  
 == Web Access and Certificates == == Web Access and Certificates ==
  
-The cloud is named **Overcloud**. The web interface at [[https://overcloud.cs.uchicago.edu]] uses a non-public certificate authority. You will have to accept it for all purposes: API, HTTPS, and CLI clients. +The cloud is named **Overcloud**. The web interface uses a non-public certificate authority and can be reached at [[https://overcloud.cs.uchicago.edu]]. You will have to accept the certificate for all purposes: API, HTTPS, and CLI clients.
- +
-NOTE: Our cloud DNS service might not meet your needs. Please test it anyway if you know how (TODO: document)+
  
 === PROJECTS === === PROJECTS ===
  
 Openstack requires Users and their cloud resources to belong to a Project. Users have pre-defined Roles within that Project, such as Member or Admin. The Role, Project, and User together constitute in-context access control. So, when a user is in a certain Project, that User can read, modify, destroy the cloud resources in that Project, or even create new resources. All actions depend on the precise Role of the User in the project. Non-members of a project are not able to do anything with cloud resources of the project to which they are a non-member, including View Access. Users can belong to any number of Projects, and with potentially different Roles. Project Admins can modify the memberships of their own Projects. However, there is __not__ a Role known as Owner. Openstack requires Users and their cloud resources to belong to a Project. Users have pre-defined Roles within that Project, such as Member or Admin. The Role, Project, and User together constitute in-context access control. So, when a user is in a certain Project, that User can read, modify, destroy the cloud resources in that Project, or even create new resources. All actions depend on the precise Role of the User in the project. Non-members of a project are not able to do anything with cloud resources of the project to which they are a non-member, including View Access. Users can belong to any number of Projects, and with potentially different Roles. Project Admins can modify the memberships of their own Projects. However, there is __not__ a Role known as Owner.
- 
  
 == Your Default Project == == Your Default Project ==
Line 81: Line 63:
 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 a 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. 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 a 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>pip install python-openstackclient</code>+Try: <code>python3 -m pip install --user python-openstackclient</code>
  
 == PRELIMINARY SETUP == == PRELIMINARY SETUP ==
Line 145: Line 127:
 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. 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.
-<code>openstack network list</code>+ 
 +<code> 
 +openstack network list 
 +</code>
  
 [EDITOR NOTE: This section should be isolated from the main body] [EDITOR NOTE: This section should be isolated from the main body]
Line 152: Line 137:
  
 Should you want to create a network of your own that your hosts will be on, not all of these options are necessary Should you want to create a network of your own that your hosts will be on, not all of these options are necessary
-<code>openstack network create mynet  --provider-network-type geneve  --enable-port-security --internal</code>+<code> 
 +openstack network create mynet 
 +  --provider-network-type geneve 
 +  --enable-port-security 
 +  --internal 
 +</code>
  
 Now create a subnet for your network. This is mandatory for launching instances in the network that you just created. Now create a subnet for your network. This is mandatory for launching instances in the network that you just created.
Line 162: Line 152:
 You are now advised that there is no "correct" choice for subnet range and IP. Overlaps are **not** a concern unless you intend to perform route/tunneling among the overlapping regions. You are now advised that there is no "correct" choice for subnet range and IP. Overlaps are **not** a concern unless you intend to perform route/tunneling among the overlapping regions.
  
-<code>openstack subnet create --network mynet --ip-version 4 --subnet-range 192.168.222.0/24 --allocation-pool start=192.168.222.10,end=192.168.222.240 --dns-nameserver 128.135.164.141 mysubnet --gateway 192.168.222.1 --dhcp</code>+<code> 
 +openstack subnet create 
 +  --network mynet 
 +  --ip-version 4 
 +  --subnet-range 192.168.222.0/24 
 +  --allocation-pool start=192.168.222.10,end=192.168.222.240 
 +  --dns-nameserver 128.135.164.141 mysubnet 
 +  --gateway 192.168.222.1 
 +  --dhcp 
 +</code>
  
 After creating your own network and subnet(s), a router is also needed. However, a router is **not** needed if your instances only talk to each other. The router will take the gateway of your subnet automatically, and allow clients to access the internet via outbound NAT. Much more is possible, and a router is a prerequisite for the next step, which is inbound NAT (DNAT). After creating your own network and subnet(s), a router is also needed. However, a router is **not** needed if your instances only talk to each other. The router will take the gateway of your subnet automatically, and allow clients to access the internet via outbound NAT. Much more is possible, and a router is a prerequisite for the next step, which is inbound NAT (DNAT).
-<code>openstack router create --enable myrouter 
-openstack router add subnet mysubnet</code> 
  
-With the router created and attached to your subnet, develop it further. First, you need to obtain a free IP address on the UC Campus. We call this network __campus37__. 
-<code>openstack floating ip create campus37</code> 
-The output of the command is shown below. Take not of the IP Address: 
 <code> <code>
-+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +openstack router create --enable myrouter 
-| Field               | Value                                                                                                                                                                                       | +</code> 
-+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +<code> 
-| created_at          | 2019-12-06T16:49:29Z                                                                                                                                                                        | +openstack router add subnet myrouter mysubnet 
-| description                                                                                                                                                                                                     | +</code>
-| dns_domain          |                                                                                                                                                                                             | +
-| dns_name            |                                                                                                                                                                                             | +
-| fixed_ip_address    | None                                                                                                                                                                                        | +
-| floating_ip_address | 128.135.37.244                                                                                                                                                                              | +
-| floating_network_id | f6a5f729-d5bf-4fa7-9cd9-e4ed23c7d48f                                                                                                                                                        | +
-| id                  | 7110ea40-8c32-4f99-8454-9a091bcd4623                                                                                                                                                        | +
-| location            | Munch({'project': Munch({'domain_name': 'Default', 'domain_id': None, 'name': 'admin', 'id': u'8fa4efd231fa4cfc886b3c55f9efdfa1'}), 'cloud': '', 'region_name': 'regionOne', 'zone': None}) | +
-| name                | 128.135.37.244                                                                                                                                                                              | +
-| port_details        | None                                                                                                                                                                                        | +
-| port_id             | None                                                                                                                                                                                        | +
-| project_id          | 8fa4efd231fa4cfc886b3c55f9efdfa1                                                                                                                                                            | +
-| qos_policy_id       | None                                                                                                                                                                                        | +
-| revision_number     | 0                                                                                                                                                                                           | +
-| router_id           | None                                                                                                                                                                                        | +
-| status              | DOWN                                                                                                                                                                                        | +
-| subnet_id           | None                                                                                                                                                                                        | +
-| tags                | []                                                                                                                                                                                          | +
-| updated_at          | 2019-12-06T16:49:29Z                                                                                                                                                                        | +
-+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+</code>+
  
-Only you will be able to use this address until you destroy it. **DONT ever take more than you need and free this resource as soon as you project ends.**+With the router created and attached to your own subnet, develop it furtherYou need to obtain a free IP address on the UC Campus. We call this network __campus37__. The Internet-connected subnet on that network is called __public37__.
  
-Give this address to your Router, on a new interface. After this command, the router will have one leg in your subnet and one leg in the public campus network (and internet). The example above gave us 128.135.37.244.+After this command, the router will have one leg in your subnet and one leg in the public campus network (and internet). 
 + 
 +Only you will be able to use this address until you destroy it**DONT ever take more than you need and free this resource as soon as you project ends.**
  
 <code> <code>
-openstack router set --fixed-ip subnet=$(openstack subnet show --format value --column id public37),ip-address=128.135.37.244 --external-gateway campus37 --enable-snat mynet+openstack router set myrouter \ 
 +  --external-gateway campus37 
 +  --enable-snat
 </code> </code>
  
Line 218: Line 197:
  
 Like other openstack activities, creating a server has __many__ complex options and scenarios. This is a simple and ordinary depiction, creating one server Like other openstack activities, creating a server has __many__ complex options and scenarios. This is a simple and ordinary depiction, creating one server
-<code>openstack server create --image bionic-server-cloudimg-amd64.raw --boot-from-volume=32 --flavor m1.small --config-drive=true --user-data=/home/chudler/openstack/cluster_test/cloud-init.yml --network mynet myserver</code>+ 
 +<code> 
 +openstack server create 
 +  --image bionic-server-cloudimg-amd64.raw 
 +  --boot-from-volume=32 
 +  --flavor m1.small 
 +  --config-drive=true 
 +  --user-data=/home/chudler/openstack/cluster_test/cloud-init.yml 
 +  --network mynet 
 +  myserver 
 +</code>
  
 The command executed asynchronously, check the status: The command executed asynchronously, check the status:
  
-<code>openstack server list --name myserver +<code> 
-openstack server show myserver</code>+openstack server list --name myserver 
 +</code> 
 +<code> 
 +openstack server show myserver 
 +</code>
  
 Here's an example for creating 10 of them, as promised (only the change at the end of the command) Here's an example for creating 10 of them, as promised (only the change at the end of the command)
-<code>openstack server create --image bionic-server-cloudimg-amd64.raw --boot-from-volume=32 --flavor m1.small --config-drive=true --user-data=/home/chudler/openstack/cluster_test/cloud-init.yml --network mynet moar --min 10 --max 10</code>+<code> 
 +openstack server create 
 +  --image bionic-server-cloudimg-amd64.raw 
 +  --boot-from-volume=32 
 +  --flavor m1.small 
 +  --config-drive=true 
 +  --user-data=/home/chudler/openstack/cluster_test/cloud-init.yml 
 +  --network mynet 
 +  --min 10 
 +  --max 10 
 +  myserver 
 +</code>
  
 Here's a nasty thing I use to determine what the security group is for a server (it can be determined also by looking at security groups directly) [ITS BRITTLE, BEWARE] Here's a nasty thing I use to determine what the security group is for a server (it can be determined also by looking at security groups directly) [ITS BRITTLE, BEWARE]
  
-<code>SEC_GROUP=$(openstack port list --server `openstack server show --format value --column id myserver` --long --column "Security Groups" --format json | jq '.[]."Security Groups"[]')</code>+<code> 
 +SEC_GROUP=$(openstack port list 
 +  --server `openstack server show --format value --column id myserver` 
 +  --long 
 +  --column "Security Groups" 
 +  --format json 
 +  | jq '.[]."Security Groups"[]' \ 
 +  | sed 's/"//g') 
 +</code>
  
 If I learned the security group successfully, I can let in SSH. By default, **no communication is possible**. If I learned the security group successfully, I can let in SSH. By default, **no communication is possible**.
  
-<code>openstack security group rule create --ingress --dst-port 22 --protocol tcp $SEC_GROUP</code>+<code> 
 +openstack security group rule create 
 +  --ingress 
 +  --dst-port 22 
 +  --protocol tcp $SEC_GROUP 
 +</code>
  
 In actual fact, all of the servers you create will be in the same security group. The above was attempting to suggest effective use of the tools, in combination. In actual fact, all of the servers you create will be in the same security group. The above was attempting to suggest effective use of the tools, in combination.
Line 242: Line 259:
 You could also use the web interface to access the console, but that's not quite the same. You could also use the web interface to access the console, but that's not quite the same.
 As before, in the Network Gear section, get a campus IP address from our pool. As before, in the Network Gear section, get a campus IP address from our pool.
-<code>openstack floating ip create</code>+ 
 + 
 +Where do you want to create your floating IP? 
 +<code> 
 +openstack network list 
 +</code> 
 +Use the network from the previous command: 
 +<code> 
 +openstack floating ip create <network> 
 +</code> 
 +You now have an IP you can use:  
 +<code> 
 +openstack server add floating ip myserver <floating_ip_address> 
 +</code> 
 + 
 +Note that the command is showing you a deeper and more rare UX pattern than before: 
 + 
 +<code> 
 +openstack server $action $subresource $more_options  
 +</code>
  
 At last, you can ssh into 128.135.37.XX. It is important for you to realize that your __local__ server IP does not change (no new interface is given to the instance). Instead, the router on the subnet simply performs DNAT on behalf of the clients. Here's another possibility: At last, you can ssh into 128.135.37.XX. It is important for you to realize that your __local__ server IP does not change (no new interface is given to the instance). Instead, the router on the subnet simply performs DNAT on behalf of the clients. Here's another possibility:
 <code>$ openstack server add network myserver campus37</code> <code>$ openstack server add network myserver campus37</code>
  
-**Now** your server does have a new interface attached to it, and will be served a DHCP address there. You will almost certainly have to inform the OS about this, and the cloud tools won'help you with that...+**Now** your server does have a **new** network interface attached to it, and will be served a DHCP address on it. You will almost certainly have to inform the OS about this manually; the cloud may not help you do that. 
 + 
 +This section added a floating ip address directly to the serverYou must realize that a router was needed on the subnet for that to happen. We had created the router earlier for the purpose of SNAT, and had we not done that, this command would have failed. This means that if you are not doing SNAT, you should create a router anyway, but __do not__ give it a campus address of its own.
  
 == A WORD ABOUT CLOUD INIT == == A WORD ABOUT CLOUD INIT ==
-Your author uses cloud init extensively and does not imagine a life without it. It is optional. The file used in these examples is attached to this email, but you should develop your own if you use it at all.+Your author uses cloud init extensively and does not imagine a life without it. It is optional. The file used in these examples is available on request, but you should develop your own if you use it at all.
  
  
-== FAQ, NAQ  (Never Asked Questions) ==+==NAQ  (Never Asked Questions) ===
  
 Q: Why does it use a self-signed certificate? Q: Why does it use a self-signed certificate?
Line 281: Line 319:
  
 Q: What about containers (docker)? Q: What about containers (docker)?
-A: We do not provide any support for them directly. We expect that you will want to manage this from inside the VMs that you create. We have no plans to deploy Magnum right now.+A: [[ cloud:recipe:docker | Container Docs ]]
  
 Q: My servers are in ERROR state!!! Q: My servers are in ERROR state!!!
/var/lib/dokuwiki/data/pages/cloud/intro.txt · Last modified: 2021/04/15 17:50 by chudler

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki