diff --git a/openstack_eosc.ipynb b/openstack_eosc.ipynb index 41e2050e193eb30d0617c8570e62d0175f7f162a..b271affb4064d0a9cf25ac2b71508c5e8a5acf71 100644 --- a/openstack_eosc.ipynb +++ b/openstack_eosc.ipynb @@ -34,66 +34,94 @@ "name": "stdout", "output_type": "stream", "text": [ - "Requirement already satisfied: python-openstackclient in /opt/conda/lib/python3.12/site-packages (8.0.0)\n", - "Requirement already satisfied: python-keystoneclient in /opt/conda/lib/python3.12/site-packages (5.6.0)\n", - "Requirement already satisfied: ipywidgets in /opt/conda/lib/python3.12/site-packages (8.1.5)\n", - "Requirement already satisfied: paramiko in /opt/conda/lib/python3.12/site-packages (3.5.1)\n", - "Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (6.1.1)\n", - "Requirement already satisfied: cryptography>=2.7 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (44.0.0)\n", - "Requirement already satisfied: cliff>=3.5.0 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (4.9.1)\n", - "Requirement already satisfied: iso8601>=0.1.11 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (2.1.0)\n", - "Requirement already satisfied: openstacksdk>=3.3.0 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (4.5.0)\n", - "Requirement already satisfied: osc-lib>=2.3.0 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (4.0.0)\n", - "Requirement already satisfied: oslo.i18n>=3.15.3 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (6.5.1)\n", - "Requirement already satisfied: python-cinderclient>=3.3.0 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (9.7.0)\n", + "Collecting python-openstackclient\n", + " Using cached python_openstackclient-8.0.0-py3-none-any.whl.metadata (6.4 kB)\n", + "Collecting python-keystoneclient\n", + " Using cached python_keystoneclient-5.6.0-py3-none-any.whl.metadata (3.7 kB)\n", + "Requirement already satisfied: ipywidgets in /opt/conda/lib/python3.12/site-packages (8.1.6)\n", + "Collecting paramiko\n", + " Using cached paramiko-3.5.1-py3-none-any.whl.metadata (4.6 kB)\n", + "Collecting pbr!=2.1.0,>=2.0.0 (from python-openstackclient)\n", + " Using cached pbr-6.1.1-py2.py3-none-any.whl.metadata (3.4 kB)\n", + "Requirement already satisfied: cryptography>=2.7 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (44.0.2)\n", + "Collecting cliff>=3.5.0 (from python-openstackclient)\n", + " Using cached cliff-4.10.0-py3-none-any.whl.metadata (1.9 kB)\n", + "Collecting iso8601>=0.1.11 (from python-openstackclient)\n", + " Using cached iso8601-2.1.0-py3-none-any.whl.metadata (3.7 kB)\n", + "Collecting openstacksdk>=3.3.0 (from python-openstackclient)\n", + " Using cached openstacksdk-4.5.0-py3-none-any.whl.metadata (12 kB)\n", + "Collecting osc-lib>=2.3.0 (from python-openstackclient)\n", + " Using cached osc_lib-4.0.0-py3-none-any.whl.metadata (3.6 kB)\n", + "Collecting oslo.i18n>=3.15.3 (from python-openstackclient)\n", + " Using cached oslo.i18n-6.5.1-py3-none-any.whl.metadata (2.1 kB)\n", + "Collecting python-cinderclient>=3.3.0 (from python-openstackclient)\n", + " Using cached python_cinderclient-9.7.0-py3-none-any.whl.metadata (19 kB)\n", "Requirement already satisfied: requests>=2.27.0 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (2.32.3)\n", - "Requirement already satisfied: stevedore>=2.0.1 in /opt/conda/lib/python3.12/site-packages (from python-openstackclient) (5.4.1)\n", - "Requirement already satisfied: debtcollector>=1.2.0 in /opt/conda/lib/python3.12/site-packages (from python-keystoneclient) (3.0.0)\n", - "Requirement already satisfied: keystoneauth1>=3.4.0 in /opt/conda/lib/python3.12/site-packages (from python-keystoneclient) (5.10.0)\n", - "Requirement already satisfied: oslo.config>=5.2.0 in /opt/conda/lib/python3.12/site-packages (from python-keystoneclient) (9.7.1)\n", - "Requirement already satisfied: oslo.serialization>=2.18.0 in /opt/conda/lib/python3.12/site-packages (from python-keystoneclient) (5.7.0)\n", - "Requirement already satisfied: oslo.utils>=3.33.0 in /opt/conda/lib/python3.12/site-packages (from python-keystoneclient) (8.2.0)\n", + "Collecting stevedore>=2.0.1 (from python-openstackclient)\n", + " Using cached stevedore-5.4.1-py3-none-any.whl.metadata (2.3 kB)\n", + "Collecting debtcollector>=1.2.0 (from python-keystoneclient)\n", + " Using cached debtcollector-3.0.0-py3-none-any.whl.metadata (2.3 kB)\n", + "Collecting keystoneauth1>=3.4.0 (from python-keystoneclient)\n", + " Using cached keystoneauth1-5.11.0-py3-none-any.whl.metadata (4.0 kB)\n", + "Collecting oslo.config>=5.2.0 (from python-keystoneclient)\n", + " Using cached oslo_config-9.8.0-py3-none-any.whl.metadata (2.8 kB)\n", + "Collecting oslo.serialization>=2.18.0 (from python-keystoneclient)\n", + " Using cached oslo.serialization-5.7.0-py3-none-any.whl.metadata (2.1 kB)\n", + "Collecting oslo.utils>=3.33.0 (from python-keystoneclient)\n", + " Using cached oslo_utils-9.0.0-py3-none-any.whl.metadata (2.2 kB)\n", "Requirement already satisfied: packaging>=20.4 in /opt/conda/lib/python3.12/site-packages (from python-keystoneclient) (24.2)\n", "Requirement already satisfied: comm>=0.1.3 in /opt/conda/lib/python3.12/site-packages (from ipywidgets) (0.2.2)\n", - "Requirement already satisfied: ipython>=6.1.0 in /opt/conda/lib/python3.12/site-packages (from ipywidgets) (8.31.0)\n", + "Requirement already satisfied: ipython>=6.1.0 in /opt/conda/lib/python3.12/site-packages (from ipywidgets) (9.1.0)\n", "Requirement already satisfied: traitlets>=4.3.1 in /opt/conda/lib/python3.12/site-packages (from ipywidgets) (5.14.3)\n", - "Requirement already satisfied: widgetsnbextension~=4.0.12 in /opt/conda/lib/python3.12/site-packages (from ipywidgets) (4.0.13)\n", - "Requirement already satisfied: jupyterlab_widgets~=3.0.12 in /opt/conda/lib/python3.12/site-packages (from ipywidgets) (3.0.13)\n", - "Requirement already satisfied: bcrypt>=3.2 in /opt/conda/lib/python3.12/site-packages (from paramiko) (4.3.0)\n", - "Requirement already satisfied: pynacl>=1.5 in /opt/conda/lib/python3.12/site-packages (from paramiko) (1.5.0)\n", - "Requirement already satisfied: autopage>=0.4.0 in /opt/conda/lib/python3.12/site-packages (from cliff>=3.5.0->python-openstackclient) (0.5.2)\n", - "Requirement already satisfied: cmd2>=1.0.0 in /opt/conda/lib/python3.12/site-packages (from cliff>=3.5.0->python-openstackclient) (2.5.11)\n", - "Requirement already satisfied: PrettyTable>=0.7.2 in /opt/conda/lib/python3.12/site-packages (from cliff>=3.5.0->python-openstackclient) (3.16.0)\n", + "Requirement already satisfied: widgetsnbextension~=4.0.14 in /opt/conda/lib/python3.12/site-packages (from ipywidgets) (4.0.14)\n", + "Requirement already satisfied: jupyterlab_widgets~=3.0.14 in /opt/conda/lib/python3.12/site-packages (from ipywidgets) (3.0.14)\n", + "Collecting bcrypt>=3.2 (from paramiko)\n", + " Using cached bcrypt-4.3.0-cp39-abi3-manylinux_2_34_x86_64.whl.metadata (10 kB)\n", + "Collecting pynacl>=1.5 (from paramiko)\n", + " Using cached PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.metadata (8.6 kB)\n", + "Collecting autopage>=0.4.0 (from cliff>=3.5.0->python-openstackclient)\n", + " Using cached autopage-0.5.2-py3-none-any.whl.metadata (7.9 kB)\n", + "Collecting cmd2>=1.0.0 (from cliff>=3.5.0->python-openstackclient)\n", + " Using cached cmd2-2.5.11-py3-none-any.whl.metadata (17 kB)\n", + "Collecting PrettyTable>=0.7.2 (from cliff>=3.5.0->python-openstackclient)\n", + " Using cached prettytable-3.16.0-py3-none-any.whl.metadata (33 kB)\n", "Requirement already satisfied: PyYAML>=3.12 in /opt/conda/lib/python3.12/site-packages (from cliff>=3.5.0->python-openstackclient) (6.0.2)\n", "Requirement already satisfied: cffi>=1.12 in /opt/conda/lib/python3.12/site-packages (from cryptography>=2.7->python-openstackclient) (1.17.1)\n", "Requirement already satisfied: wrapt>=1.7.0 in /opt/conda/lib/python3.12/site-packages (from debtcollector>=1.2.0->python-keystoneclient) (1.17.2)\n", - "Requirement already satisfied: decorator in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (5.1.1)\n", + "Requirement already satisfied: decorator in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (5.2.1)\n", + "Requirement already satisfied: ipython-pygments-lexers in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (1.1.1)\n", "Requirement already satisfied: jedi>=0.16 in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (0.19.2)\n", "Requirement already satisfied: matplotlib-inline in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (0.1.7)\n", "Requirement already satisfied: pexpect>4.3 in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (4.9.0)\n", - "Requirement already satisfied: prompt_toolkit<3.1.0,>=3.0.41 in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (3.0.48)\n", - "Requirement already satisfied: pygments>=2.4.0 in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (2.18.0)\n", + "Requirement already satisfied: prompt_toolkit<3.1.0,>=3.0.41 in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (3.0.50)\n", + "Requirement already satisfied: pygments>=2.4.0 in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (2.19.1)\n", "Requirement already satisfied: stack_data in /opt/conda/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets) (0.6.3)\n", - "Requirement already satisfied: os-service-types>=1.2.0 in /opt/conda/lib/python3.12/site-packages (from keystoneauth1>=3.4.0->python-keystoneclient) (1.7.0)\n", - "Requirement already satisfied: typing-extensions>=4.12 in /opt/conda/lib/python3.12/site-packages (from keystoneauth1>=3.4.0->python-keystoneclient) (4.12.2)\n", - "Requirement already satisfied: dogpile.cache>=0.6.5 in /opt/conda/lib/python3.12/site-packages (from openstacksdk>=3.3.0->python-openstackclient) (1.3.4)\n", + "Collecting os-service-types>=1.2.0 (from keystoneauth1>=3.4.0->python-keystoneclient)\n", + " Using cached os_service_types-1.7.0-py2.py3-none-any.whl.metadata (1.7 kB)\n", + "Requirement already satisfied: typing-extensions>=4.12 in /opt/conda/lib/python3.12/site-packages (from keystoneauth1>=3.4.0->python-keystoneclient) (4.13.2)\n", + "Collecting dogpile.cache>=0.6.5 (from openstacksdk>=3.3.0->python-openstackclient)\n", + " Using cached dogpile_cache-1.4.0-py3-none-any.whl.metadata (5.5 kB)\n", "Requirement already satisfied: jmespath>=0.9.0 in /opt/conda/lib/python3.12/site-packages (from openstacksdk>=3.3.0->python-openstackclient) (1.0.1)\n", "Requirement already satisfied: jsonpatch!=1.20,>=1.16 in /opt/conda/lib/python3.12/site-packages (from openstacksdk>=3.3.0->python-openstackclient) (1.33)\n", - "Requirement already satisfied: platformdirs>=3 in /opt/conda/lib/python3.12/site-packages (from openstacksdk>=3.3.0->python-openstackclient) (4.3.6)\n", + "Requirement already satisfied: platformdirs>=3 in /opt/conda/lib/python3.12/site-packages (from openstacksdk>=3.3.0->python-openstackclient) (4.3.7)\n", "Requirement already satisfied: psutil>=3.2.2 in /opt/conda/lib/python3.12/site-packages (from openstacksdk>=3.3.0->python-openstackclient) (5.9.8)\n", - "Requirement already satisfied: requestsexceptions>=1.2.0 in /opt/conda/lib/python3.12/site-packages (from openstacksdk>=3.3.0->python-openstackclient) (1.4.0)\n", - "Requirement already satisfied: netaddr>=0.7.18 in /opt/conda/lib/python3.12/site-packages (from oslo.config>=5.2.0->python-keystoneclient) (1.3.0)\n", - "Requirement already satisfied: rfc3986>=1.2.0 in /opt/conda/lib/python3.12/site-packages (from oslo.config>=5.2.0->python-keystoneclient) (2.0.0)\n", + "Collecting requestsexceptions>=1.2.0 (from openstacksdk>=3.3.0->python-openstackclient)\n", + " Using cached requestsexceptions-1.4.0-py2.py3-none-any.whl.metadata (1.2 kB)\n", + "Collecting netaddr>=0.7.18 (from oslo.config>=5.2.0->python-keystoneclient)\n", + " Using cached netaddr-1.3.0-py3-none-any.whl.metadata (5.0 kB)\n", + "Collecting rfc3986>=1.2.0 (from oslo.config>=5.2.0->python-keystoneclient)\n", + " Using cached rfc3986-2.0.0-py2.py3-none-any.whl.metadata (6.6 kB)\n", "Requirement already satisfied: msgpack>=0.5.2 in /opt/conda/lib/python3.12/site-packages (from oslo.serialization>=2.18.0->python-keystoneclient) (1.1.0)\n", - "Requirement already satisfied: tzdata>=2022.4 in /opt/conda/lib/python3.12/site-packages (from oslo.serialization>=2.18.0->python-keystoneclient) (2024.2)\n", - "Requirement already satisfied: pyparsing>=2.1.0 in /opt/conda/lib/python3.12/site-packages (from oslo.utils>=3.33.0->python-keystoneclient) (3.2.0)\n", - "Requirement already satisfied: setuptools in /opt/conda/lib/python3.12/site-packages (from pbr!=2.1.0,>=2.0.0->python-openstackclient) (75.6.0)\n", - "Requirement already satisfied: charset_normalizer<4,>=2 in /opt/conda/lib/python3.12/site-packages (from requests>=2.27.0->python-openstackclient) (3.4.0)\n", + "Requirement already satisfied: tzdata>=2022.4 in /opt/conda/lib/python3.12/site-packages (from oslo.serialization>=2.18.0->python-keystoneclient) (2025.2)\n", + "Requirement already satisfied: pyparsing>=2.1.0 in /opt/conda/lib/python3.12/site-packages (from oslo.utils>=3.33.0->python-keystoneclient) (3.2.3)\n", + "Requirement already satisfied: setuptools in /opt/conda/lib/python3.12/site-packages (from pbr!=2.1.0,>=2.0.0->python-openstackclient) (78.1.0)\n", + "Requirement already satisfied: charset_normalizer<4,>=2 in /opt/conda/lib/python3.12/site-packages (from requests>=2.27.0->python-openstackclient) (3.4.1)\n", "Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.12/site-packages (from requests>=2.27.0->python-openstackclient) (3.10)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/lib/python3.12/site-packages (from requests>=2.27.0->python-openstackclient) (2.3.0)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.12/site-packages (from requests>=2.27.0->python-openstackclient) (2024.12.14)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/lib/python3.12/site-packages (from requests>=2.27.0->python-openstackclient) (2.4.0)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.12/site-packages (from requests>=2.27.0->python-openstackclient) (2025.1.31)\n", "Requirement already satisfied: pycparser in /opt/conda/lib/python3.12/site-packages (from cffi>=1.12->cryptography>=2.7->python-openstackclient) (2.22)\n", - "Requirement already satisfied: pyperclip>=1.8 in /opt/conda/lib/python3.12/site-packages (from cmd2>=1.0.0->cliff>=3.5.0->python-openstackclient) (1.9.0)\n", + "Collecting pyperclip>=1.8 (from cmd2>=1.0.0->cliff>=3.5.0->python-openstackclient)\n", + " Using cached pyperclip-1.9.0-py3-none-any.whl\n", "Requirement already satisfied: wcwidth>=0.2.10 in /opt/conda/lib/python3.12/site-packages (from cmd2>=1.0.0->cliff>=3.5.0->python-openstackclient) (0.2.13)\n", "Requirement already satisfied: parso<0.9.0,>=0.8.4 in /opt/conda/lib/python3.12/site-packages (from jedi>=0.16->ipython>=6.1.0->ipywidgets) (0.8.4)\n", "Requirement already satisfied: jsonpointer>=1.9 in /opt/conda/lib/python3.12/site-packages (from jsonpatch!=1.20,>=1.16->openstacksdk>=3.3.0->python-openstackclient) (3.0.0)\n", @@ -101,6 +129,34 @@ "Requirement already satisfied: executing>=1.2.0 in /opt/conda/lib/python3.12/site-packages (from stack_data->ipython>=6.1.0->ipywidgets) (2.1.0)\n", "Requirement already satisfied: asttokens>=2.1.0 in /opt/conda/lib/python3.12/site-packages (from stack_data->ipython>=6.1.0->ipywidgets) (3.0.0)\n", "Requirement already satisfied: pure_eval in /opt/conda/lib/python3.12/site-packages (from stack_data->ipython>=6.1.0->ipywidgets) (0.2.3)\n", + "Using cached python_openstackclient-8.0.0-py3-none-any.whl (1.1 MB)\n", + "Using cached python_keystoneclient-5.6.0-py3-none-any.whl (397 kB)\n", + "Using cached paramiko-3.5.1-py3-none-any.whl (227 kB)\n", + "Using cached bcrypt-4.3.0-cp39-abi3-manylinux_2_34_x86_64.whl (284 kB)\n", + "Using cached cliff-4.10.0-py3-none-any.whl (84 kB)\n", + "Using cached debtcollector-3.0.0-py3-none-any.whl (23 kB)\n", + "Using cached iso8601-2.1.0-py3-none-any.whl (7.5 kB)\n", + "Using cached keystoneauth1-5.11.0-py3-none-any.whl (344 kB)\n", + "Using cached openstacksdk-4.5.0-py3-none-any.whl (1.8 MB)\n", + "Using cached osc_lib-4.0.0-py3-none-any.whl (93 kB)\n", + "Using cached oslo_config-9.8.0-py3-none-any.whl (131 kB)\n", + "Using cached oslo.i18n-6.5.1-py3-none-any.whl (46 kB)\n", + "Using cached oslo.serialization-5.7.0-py3-none-any.whl (25 kB)\n", + "Using cached oslo_utils-9.0.0-py3-none-any.whl (134 kB)\n", + "Using cached pbr-6.1.1-py2.py3-none-any.whl (108 kB)\n", + "Using cached PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB)\n", + "Using cached python_cinderclient-9.7.0-py3-none-any.whl (256 kB)\n", + "Using cached stevedore-5.4.1-py3-none-any.whl (49 kB)\n", + "Using cached autopage-0.5.2-py3-none-any.whl (30 kB)\n", + "Using cached cmd2-2.5.11-py3-none-any.whl (152 kB)\n", + "Using cached dogpile_cache-1.4.0-py3-none-any.whl (62 kB)\n", + "Using cached netaddr-1.3.0-py3-none-any.whl (2.3 MB)\n", + "Using cached os_service_types-1.7.0-py2.py3-none-any.whl (24 kB)\n", + "Using cached prettytable-3.16.0-py3-none-any.whl (33 kB)\n", + "Using cached requestsexceptions-1.4.0-py2.py3-none-any.whl (3.8 kB)\n", + "Using cached rfc3986-2.0.0-py2.py3-none-any.whl (31 kB)\n", + "Installing collected packages: requestsexceptions, pyperclip, rfc3986, PrettyTable, pbr, netaddr, iso8601, debtcollector, cmd2, bcrypt, autopage, stevedore, pynacl, oslo.i18n, os-service-types, paramiko, oslo.utils, oslo.config, keystoneauth1, dogpile.cache, cliff, python-cinderclient, oslo.serialization, openstacksdk, python-keystoneclient, osc-lib, python-openstackclient\n", + "Successfully installed PrettyTable-3.16.0 autopage-0.5.2 bcrypt-4.3.0 cliff-4.10.0 cmd2-2.5.11 debtcollector-3.0.0 dogpile.cache-1.4.0 iso8601-2.1.0 keystoneauth1-5.11.0 netaddr-1.3.0 openstacksdk-4.5.0 os-service-types-1.7.0 osc-lib-4.0.0 oslo.config-9.8.0 oslo.i18n-6.5.1 oslo.serialization-5.7.0 oslo.utils-9.0.0 paramiko-3.5.1 pbr-6.1.1 pynacl-1.5.0 pyperclip-1.9.0 python-cinderclient-9.7.0 python-keystoneclient-5.6.0 python-openstackclient-8.0.0 requestsexceptions-1.4.0 rfc3986-2.0.0 stevedore-5.4.1\n", "Note: you may need to restart the kernel to use updated packages.\n" ] } @@ -111,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "c3718348-c7df-44d3-9811-66b7fa7ec7fb", "metadata": {}, "outputs": [], @@ -155,7 +211,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "id": "5bc6fac0-c5fa-44a7-9d29-38ea5164e4bc", "metadata": {}, "outputs": [], @@ -186,12 +242,14 @@ "The Keystone client is used to interact with OpenStack's identity service and enables to:\n", "\n", "- Access OpenStack components not exposed in the primary API.\n", - "- Retrieve detailed information about your projects" + "- Retrieve detailed information about your projects\n", + "\n", + "Make sure to authenticate on https://eu-1.iaas.open-science-cloud.ec.europa.eu/ page" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "id": "b871dc55-172a-43da-81d7-b7fa796a7c2c", "metadata": {}, "outputs": [], @@ -203,7 +261,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "id": "9a58d8c5-7dcd-4549-9b10-0456ccd66b30", "metadata": {}, "outputs": [ @@ -222,7 +280,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "90ef16930f794a71812097ee87883176", + "model_id": "190f79eec3d64952a1941b37feeecd98", "version_major": 2, "version_minor": 0 }, @@ -236,7 +294,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "43118c111a1740f7898f72861426f2ca", + "model_id": "0935ef7d353949ec8c78bb3409af17f8", "version_major": 2, "version_minor": 0 }, @@ -250,7 +308,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "1cd77110d36042578de07d7469959646", + "model_id": "a0095b69890e4fca99fb7ba40b204a4e", "version_major": 2, "version_minor": 0 }, @@ -300,7 +358,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "id": "7c50e961-b797-4e1c-a91b-e44487324c0c", "metadata": {}, "outputs": [ @@ -333,7 +391,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "id": "5e4b3a58-687b-471f-8c7f-a6db86bde820", "metadata": {}, "outputs": [ @@ -385,7 +443,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 8, "id": "aceddf23-baeb-4e86-8100-52beec7241a4", "metadata": {}, "outputs": [ @@ -454,7 +512,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "id": "5e29662e-1576-48f8-9ae2-f9e2be0ffc60", "metadata": {}, "outputs": [ @@ -473,7 +531,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "341b08877fcc44f7a71e223b2713cdf0", + "model_id": "1ee722a7e3e5472d8af3d9037a8eaaa5", "version_major": 2, "version_minor": 0 }, @@ -499,7 +557,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "a8ba85e215494b91a0b93a6e01128471", + "model_id": "5effa4322c8d48bd83cf2538e407246c", "version_major": 2, "version_minor": 0 }, @@ -525,7 +583,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "3eefc30da3834df793223ad458b594a0", + "model_id": "8597753cd65e4382b60bb254807df518", "version_major": 2, "version_minor": 0 }, @@ -581,7 +639,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 10, "id": "c10e65f1-1e6e-44f4-8e86-aa6e5452d10c", "metadata": {}, "outputs": [], @@ -598,7 +656,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 11, "id": "616210a6-a2f4-4732-bdbe-b37684d9dd74", "metadata": {}, "outputs": [ @@ -642,7 +700,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 12, "id": "f9a37e64-ba85-43b3-b234-9ac09e743951", "metadata": {}, "outputs": [ @@ -651,7 +709,7 @@ "output_type": "stream", "text": [ "Creating private network...\n", - "Created network: My private network (ID: fca7d4d2-4c2c-4a25-9ed8-9d65c9d0d52f)\n" + "Created network: My private network (ID: 8207ddc7-4002-40d7-b9b5-cfedf6247024)\n" ] } ], @@ -679,7 +737,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 13, "id": "6a36a9da-14fc-41be-92a7-6e4b140c1d47", "metadata": {}, "outputs": [ @@ -688,7 +746,7 @@ "output_type": "stream", "text": [ "Creating subnet...\n", - "Created subnet: My internal network (ID: 7558ff73-1885-4707-aa2e-bf9dbdd0fa19)\n" + "Created subnet: My internal network (ID: 444e1046-e893-4381-b092-b7645bd96347)\n" ] } ], @@ -717,7 +775,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 14, "id": "1720eb87-7fb2-420b-bac4-2b9d8f5c0d31", "metadata": {}, "outputs": [ @@ -726,7 +784,7 @@ "output_type": "stream", "text": [ "Creating router with external network: PSNC-EXT-PUB1-EDU\n", - "Created router: My router (ID: 57abc611-b306-458e-bb17-cbdc49cdf9fb)\n", + "Created router: My router (ID: cbde5d42-2001-4a9c-a1aa-fa2ef97e31f6)\n", "Connected subnet My internal network to router My router\n" ] } @@ -768,32 +826,75 @@ "## 🚀 Launch VM" ] }, + { + "cell_type": "markdown", + "id": "7f29a0cd-897c-4c93-81d7-edf8d24f7240", + "metadata": {}, + "source": [ + "> Create a new volume for VM with a size of 10 GB using your OpenStack connection" + ] + }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 24, + "id": "1329314a-9aad-4bee-97b4-f4fe2022e42a", + "metadata": {}, + "outputs": [], + "source": [ + "new_volume = scoped_openstack_connection.create_volume(10)" + ] + }, + { + "cell_type": "markdown", + "id": "9d8c4f19-da3b-4faa-99fb-1d79f194c637", + "metadata": {}, + "source": [ + "### Launch VM and run a **cloud-init** script to:\n", + " - Update system packages\n", + " - Install **NGINX**\n", + " - Set up a simple homepage" + ] + }, + { + "cell_type": "code", + "execution_count": 17, "id": "4cd699a0-ddd6-4356-b828-95673e15e405", "metadata": {}, "outputs": [], "source": [ "# VM parameters\n", - "new_volume = scoped_openstack_connection.create_volume(10)\n", + "cloud_init_script = \"\"\"#!/bin/bash\n", + "apt-get update\n", + "apt-get upgrade -y\n", + "apt-get install -y nginx\n", + "echo 'Hello from my VM' > /var/www/html/index.html\n", + "\"\"\"\n", "vm_name = \"new_vm\"\n", "server = scoped_openstack_connection.create_server(\n", " name=vm_name,\n", " image=selected_image,\n", " flavor=selected_flavor,\n", " network=network, # Use new private network\n", + " userdata=cloud_init_script,\n", " key_name=\"key\",\n", " volumes=[new_volume],\n", " security_groups=[new_security_group.name]\n", ")\n", "# Waiting until all is ready\n", - "time.sleep(10)" + "time.sleep(170)" + ] + }, + { + "cell_type": "markdown", + "id": "915cde8d-f668-44a1-913d-24436a93e4d4", + "metadata": {}, + "source": [ + "> It will take some time for `cloud_init_script` to finish." ] }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 18, "id": "47ac6e4e-ee8d-413b-a7bf-a7f1562d01e7", "metadata": {}, "outputs": [], @@ -807,12 +908,13 @@ "id": "eeae3963-20cf-4283-a40c-c6ab54ebea7d", "metadata": {}, "source": [ - "### Configure floating IP associated with the VM for an external access" + "### Configure floating IP associated with the VM for an external access\n", + "To enable external access to your VM, create a floating IP and associate it with your external network:\n" ] }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 19, "id": "b61224ce-446d-42f7-b3d6-12e204ef26b5", "metadata": {}, "outputs": [], @@ -822,7 +924,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 20, "id": "d547d657-15d5-4c9f-86f8-2ffd6f2f3466", "metadata": {}, "outputs": [ @@ -830,7 +932,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Floating IP: 62.3.174.55\n" + "Floating IP: 62.3.174.177\n" ] } ], @@ -849,17 +951,17 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 21, "id": "8b06239e-fae7-464e-a887-5ce9c36b124c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "openstack.compute.v2.server.Server(id=63542c19-0751-4b99-a42d-3d5cc22bb1a6, name=new_vm, status=BUILD, tenant_id=db6b4eb2d6fe454191e8d39b088564cd, user_id=0814e963545daece81ed1e1bda7b90ca33b58889e97e843aeb29ac634d15ae84, metadata={}, hostId=d54760d94ecc699c04cb77d71fa37050d12057e3460d7661477b5bf8, image={'id': '7816da3d-cc63-4f01-bc2a-832bf2391eb8', 'links': [{'rel': 'bookmark', 'href': 'https://claudius.cloud.psnc.pl:8774/images/7816da3d-cc63-4f01-bc2a-832bf2391eb8'}]}, flavor={'vcpus': 2, 'ram': 8192, 'disk': 50, 'ephemeral': 0, 'swap': 0, 'original_name': 'M1-NVME-2vCPU-8R-50D', 'extra_specs': {'aggregate_instance_extra_specs:nvme': 'general-purpose', 'quota:disk_read_bytes_sec': '524288000', 'quota:disk_read_iops_sec': '50000', 'quota:disk_write_bytes_sec': '524288000', 'quota:disk_write_iops_sec': '10000'}}, created=2025-04-14T08:26:48Z, updated=2025-04-14T08:26:52Z, addresses={}, accessIPv4=, accessIPv6=, links=[{'rel': 'self', 'href': 'https://claudius.cloud.psnc.pl:8774/v2.1/servers/63542c19-0751-4b99-a42d-3d5cc22bb1a6'}, {'rel': 'bookmark', 'href': 'https://claudius.cloud.psnc.pl:8774/servers/63542c19-0751-4b99-a42d-3d5cc22bb1a6'}], OS-DCF:diskConfig=MANUAL, progress=0, OS-EXT-AZ:availability_zone=BST0K10, pinned_availability_zone=BST0K10, config_drive=, key_name=key, OS-SRV-USG:launched_at=None, OS-SRV-USG:terminated_at=None, security_groups=[{'name': 'My VM Security Group'}], OS-EXT-STS:task_state=spawning, OS-EXT-STS:vm_state=building, OS-EXT-STS:power_state=0, os-extended-volumes:volumes_attached=[{'id': '6395a1f4-644e-4a6a-9d98-7892dba997b0', 'delete_on_termination': False}], locked=False, locked_reason=None, description=None, tags=[], trusted_image_certificates=None, OS-EXT-SRV-ATTR:hostname=new-vm, server_groups=[], location=Munch({'cloud': 'api.cloud.psnc.pl', 'region_name': None, 'zone': 'BST0K10', 'project': Munch({'id': 'db6b4eb2d6fe454191e8d39b088564cd', 'name': None, 'domain_id': None, 'domain_name': None})}))" + "openstack.compute.v2.server.Server(id=e9ff03f2-2c79-4fed-a0bd-0db03a0d77c6, name=new_vm, status=ACTIVE, tenant_id=db6b4eb2d6fe454191e8d39b088564cd, user_id=0814e963545daece81ed1e1bda7b90ca33b58889e97e843aeb29ac634d15ae84, metadata={}, hostId=00645010378491da449ee53dea83e56eb7bb1376bc695df081a5f6ec, image={'id': '7816da3d-cc63-4f01-bc2a-832bf2391eb8', 'links': [{'rel': 'bookmark', 'href': 'https://claudius.cloud.psnc.pl:8774/images/7816da3d-cc63-4f01-bc2a-832bf2391eb8'}]}, flavor={'vcpus': 2, 'ram': 8192, 'disk': 50, 'ephemeral': 0, 'swap': 0, 'original_name': 'M1-NVME-2vCPU-8R-50D', 'extra_specs': {'aggregate_instance_extra_specs:nvme': 'general-purpose', 'quota:disk_read_bytes_sec': '524288000', 'quota:disk_read_iops_sec': '50000', 'quota:disk_write_bytes_sec': '524288000', 'quota:disk_write_iops_sec': '10000'}}, created=2025-05-20T08:54:21Z, updated=2025-05-20T08:55:13Z, addresses={'My private network': [{'version': 4, 'addr': '192.168.1.176', 'OS-EXT-IPS:type': 'fixed', 'OS-EXT-IPS-MAC:mac_addr': 'fa:16:3e:f4:dd:5d'}]}, accessIPv4=, accessIPv6=, links=[{'rel': 'self', 'href': 'https://claudius.cloud.psnc.pl:8774/v2.1/servers/e9ff03f2-2c79-4fed-a0bd-0db03a0d77c6'}, {'rel': 'bookmark', 'href': 'https://claudius.cloud.psnc.pl:8774/servers/e9ff03f2-2c79-4fed-a0bd-0db03a0d77c6'}], OS-DCF:diskConfig=MANUAL, progress=0, OS-EXT-AZ:availability_zone=BST0K10, pinned_availability_zone=BST0K10, config_drive=, key_name=key, OS-SRV-USG:launched_at=2025-05-20T08:55:13.000000, OS-SRV-USG:terminated_at=None, security_groups=[{'name': 'My VM Security Group'}], OS-EXT-STS:task_state=None, OS-EXT-STS:vm_state=active, OS-EXT-STS:power_state=1, os-extended-volumes:volumes_attached=[{'id': 'e5144f9b-0047-419c-861a-42a30d06dfb5', 'delete_on_termination': False}], locked=False, locked_reason=None, description=None, tags=[], trusted_image_certificates=None, OS-EXT-SRV-ATTR:hostname=new-vm, server_groups=[], location=Munch({'cloud': 'api.cloud.psnc.pl', 'region_name': None, 'zone': 'BST0K10', 'project': Munch({'id': 'db6b4eb2d6fe454191e8d39b088564cd', 'name': None, 'domain_id': None, 'domain_name': None})}))" ] }, - "execution_count": 26, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -884,16 +986,12 @@ "id": "ffd09a73-4a84-440e-8e8c-117b6b4163fc", "metadata": {}, "source": [ - "### 🔌 Connect to Your VM via SSH and configure web page\n", - "- Run a **cloud-init-like** script to:\n", - " - Update system packages\n", - " - Install **NGINX**\n", - " - Set up a simple homepage" + "### 🔌 Connect to Your VM via SSH " ] }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 22, "id": "43fbe01e-163a-44b1-ba1d-e7589562a918", "metadata": {}, "outputs": [ @@ -901,9 +999,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "Connecting to VM at 62.3.174.55...\n", - "Try accessing: http://62.3.174.55\n", - "Access VM via ssh: ssh -i mykey.pem ubuntu@62.3.174.55\n" + "Connecting to VM at 62.3.174.177...\n", + "Try accessing: http://62.3.174.177\n", + "Access VM via ssh: ssh -i mykey.pem ubuntu@62.3.174.177\n" ] } ], @@ -915,15 +1013,8 @@ " ssh.connect(\n", " hostname=floating_ip_address,\n", " username=\"ubuntu\",\n", - " key_filename=\"key.pem\" # \"/path/to/mykey.pem\"\n", + " key_filename=\"key.pem\" # \"/path/to/key.pem\"\n", " )\n", - " cloud_init_script = \"\"\"\n", - " sudo apt-get update\n", - " sudo apt-get upgrade -y\n", - " sudo apt-get install -y nginx\n", - " sudo bash -c \"echo 'Hello from my VM' > /var/www/html/index.html\"\n", - " \"\"\"\n", - " ssh.exec_command(cloud_init_script)\n", " ssh.close()\n", "except Exception as e:\n", " print(f\"SSH failed: {e}\")\n", @@ -933,14 +1024,6 @@ "print(f\"Access VM via ssh: ssh -i mykey.pem ubuntu@{floating_ip_address}\")" ] }, - { - "cell_type": "markdown", - "id": "2e5e5e46-791d-406a-9f6f-be3d0c234b0d", - "metadata": {}, - "source": [ - "> It will take some time for script to finish, so the provided link will not be accessible instantly" - ] - }, { "cell_type": "markdown", "id": "dd588470-3fc1-4b41-9bba-c929743fa9c9", @@ -1020,7 +1103,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 25, "id": "301cbef1-ec92-439f-8f2d-fca92e2c33a9", "metadata": {}, "outputs": [ @@ -1030,7 +1113,7 @@ "True" ] }, - "execution_count": 30, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -1042,17 +1125,17 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 29, "id": "dc283305-7e0e-4967-84e9-d1573b45136e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "False" + "True" ] }, - "execution_count": 31, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -1060,8 +1143,41 @@ "source": [ "# If you do not wish to use generated key-pair anymore\n", "# you can simply delete it\n", - "scoped_openstack_connection.delete_keypair(\"mykey\")" + "scoped_openstack_connection.delete_keypair(\"key\")" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "c642ccf6-83d8-4e8e-9d3d-0774b16706fc", + "metadata": {}, + "outputs": [], + "source": [ + "# Detach router interface first\n", + "scoped_openstack_connection.network.remove_interface_from_router(\n", + " router,\n", + " subnet_id=subnet.id \n", + ")\n", + "scoped_openstack_connection.network.delete_router(router)\n", + "scoped_openstack_connection.network.delete_security_group(new_security_group)\n", + "scoped_openstack_connection.network.delete_network(network)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "189c00ae-378d-4647-8226-bb5e1e5e0c03", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "31a05bda-47a1-4d00-abe5-3514cff6a7cb", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -1080,7 +1196,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.8" + "version": "3.12.10" } }, "nbformat": 4,