Microstack - Cannont access (ping/ssh) launched VMs - openstack

I am trying to access some launched VMs without success. I followed this tutorial to create a private network. It is listed below:
+--------------------------------------+----------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+----------+--------------------------------------+
| 326a319c-e75d-48f1-ac36-aed342c45874 | private | f16b8b8c-482e-4cf5-a5d6-74e284b7e0f1 |
The security groups are listed below:
microstack.openstack security group list
+--------------------------------------+---------+------------------------+----------------------------------+------+
| ID | Name | Description | Project | Tags |
+--------------------------------------+---------+------------------------+----------------------------------+------+
| 04c5c579-91bf-4497-bd01-47c7fa69df81 | default | Default security group | 9c12393bf2e54547bef78aac510ba6c6 | [] |
| 3c69498c-c210-48c8-ba43-fbf60a0c224e | default | Default security group | 37f73779b3cd42dc96044ea0fd6d1e98 | [] |
| 5a20b02a-aac4-4c62-9ea2-24dfd8c59f67 | default | Default security group | | [] |
+--------------------------------------+---------+------------------------+----------------------------------+------+
I am using the following security group:
microstack.openstack security group show 3c69498c-c210-48c8-ba43-fbf60a0c224e
+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at | 2020-08-14T17:54:45Z |
| description | Default security group |
| id | 3c69498c-c210-48c8-ba43-fbf60a0c224e |
| location | Munch({'cloud': '', 'region_name': '', 'zone': None, 'project': Munch({'id': '37f73779b3cd42dc96044ea0fd6d1e98', 'name': 'admin', 'domain_id': None, 'domain_name': 'default'})}) |
| name | default |
| project_id | 37f73779b3cd42dc96044ea0fd6d1e98 |
| revision_number | 3 |
| rules | created_at='2020-08-14T17:54:45Z', direction='egress', ethertype='IPv6', id='1e5c2fed-7c7a-4dd4-9e11-c87d0de012ee', updated_at='2020-08-14T17:54:45Z' |
| | created_at='2020-08-14T17:54:45Z', direction='ingress', ethertype='IPv4', id='36394ec6-0f35-4b26-9788-61bf76a08088', remote_group_id='3c69498c-c210-48c8-ba43-fbf60a0c224e', updated_at='2020-08-14T17:54:45Z' |
| | created_at='2020-08-14T17:54:45Z', direction='ingress', ethertype='IPv6', id='48986d96-ec57-4f49-aee8-6e1c68e273b1', remote_group_id='3c69498c-c210-48c8-ba43-fbf60a0c224e', updated_at='2020-08-14T17:54:45Z' |
| | created_at='2020-08-14T17:56:16Z', direction='ingress', ethertype='IPv4', id='58816267-8df8-4a89-a9c5-31986a441365', port_range_max='22', port_range_min='22', protocol='tcp', remote_ip_prefix='0.0.0.0/0', updated_at='2020-08-14T17:56:16Z' |
| | created_at='2020-08-14T17:54:45Z', direction='egress', ethertype='IPv4', id='c75e9aa8-84f3-4d05-9d33-0da7892f7a07', updated_at='2020-08-14T17:54:45Z' |
| | created_at='2020-08-14T17:56:14Z', direction='ingress', ethertype='IPv4', id='d029b66c-219e-488d-93af-1f87a9d8b006', protocol='icmp', remote_ip_prefix='0.0.0.0/0', updated_at='2020-08-14T17:56:14Z' |
| tags | [] |
| updated_at | 2020-08-14T17:56:16Z |
The command I used to launch the VM:
microstack.openstack server create --flavor m1.medium --image ubuntu_1804 --nic net-id=326a319c-e75d-48f1-ac36-aed342c45874 --key-name microstack --security-group 3c69498c-c210-48c8-ba43-fbf60a0c224e server_micro
Below, we can see the VM was launched:
microstack.openstack server list
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+--------------+--------+-----------------------------------+-------------+-----------+
| 9e88311d-0907-4534-ba5d-ee80d2de06ee | server_micro | ACTIVE | private=10.0.0.127 | ubuntu_1804 | m1.medium |
microstack.openstack server show 9e88311d-0907-4534-ba5d-ee80d2de06ee
+-------------------------------------+----------------------------------------------------------+
| Field | Value |
+-------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | jabuti |
| OS-EXT-SRV-ATTR:hypervisor_hostname | jabuti |
| OS-EXT-SRV-ATTR:instance_name | instance-0000000a |
| OS-EXT-STS:power_state | Running |
| OS-EXT-STS:task_state | None |
| OS-EXT-STS:vm_state | active |
| OS-SRV-USG:launched_at | 2020-08-31T13:54:52.000000 |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| addresses | private=10.0.0.127 |
| config_drive | |
| created | 2020-08-31T13:54:45Z |
| flavor | m1.medium (3) |
| hostId | 61fe40d2c4303db62eef04a071c6d7ee01f0465ec467f911ac05e2c0 |
| id | 9e88311d-0907-4534-ba5d-ee80d2de06ee |
| image | ubuntu_1804 (a1d60e2d-72d7-47d8-8aea-e97e8ba2a09b) |
| key_name | microstack |
| name | server_micro |
| progress | 0 |
| project_id | 37f73779b3cd42dc96044ea0fd6d1e98 |
| properties | |
| security_groups | name='default' |
| status | ACTIVE |
| updated | 2020-08-31T13:54:53Z |
| user_id | ff66b68443994bfeb2101851e7ea026d |
| volumes_attached | |
+-------------------------------------+----------------------------------------------------------+
But I cannot access the launched instance:
ping 10.0.0.127
PING 10.0.0.127 (10.0.0.127) 56(84) bytes of data.
From 10.75.211.9: icmp_seq=2 Redirect Host(New nexthop: 10.75.211.13)
From 10.75.211.9: icmp_seq=3 Redirect Host(New nexthop: 10.75.211.13)
From 10.75.211.9: icmp_seq=4 Redirect Host(New nexthop: 10.75.211.13)
From 10.75.211.9: icmp_seq=5 Redirect Host(New nexthop: 10.75.211.13)
^C
--- 10.0.0.127 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4004ms
What am I missing? What should I do to ping/ssh the launched instance?

Once we create a VM with a private network, we need to associate a floating IP to it. Below, I list the steps needed to solve the problem.
Create a floating IP for your external network:
microstack.openstack floating ip create external
Create a router to communicate both networks (internal and external):
microstack.openstack router create router1
Add the external network to the router:
microstack.openstack router set router1 --external-gateway external
Add your private subnetwork to the router:
microstack.openstack router add subnet router1 f16b8b8c-482e-4cf5-a5d6-74e284b7e0f1
Associate the floating IP to your VM (suppose the created IP is 10.20.20.92):
microstack.openstack server add floating ip server_micro 10.20.20.92
Now you should be able to ping the VM and access it through ssh.

Related

volume backup create what is errno 22?

Trying to create a volume backup both using the web UI and the cmd and keep getting errno 22. I'm unable to find information about the error or how to fix it. Anyone knows where I should start looking?
(openstack) volume backup create --force --name inventory01_vol_backups 398ee974-9b83-4918-9935-f52882b3e6b7
(openstack) volume backup show inventory01_vol_backups
+-----------------------+------------------------------------------------------------------+
| Field | Value |
+-----------------------+------------------------------------------------------------------+
| availability_zone | None |
| container | None |
| created_at | 2021-08-03T23:45:49.000000 |
| data_timestamp | 2021-08-03T23:45:49.000000 |
| description | None |
| fail_reason | [errno 22] RADOS invalid argument (error calling conf_read_file) |
| has_dependent_backups | False |
| id | 924c6e62-789e-4e51-9748-927695fc744c |
| is_incremental | False |
| name | inventory01_vol_backups |
| object_count | 0 |
| size | 30 |
| snapshot_id | None |
| status | error |
| updated_at | 2021-08-03T23:45:50.000000 |
| volume_id | 398ee974-9b83-4918-9935-f52882b3e6b7 |
+-----------------------+------------------------------------------------------------------+
The issue was caused due to a bug in Cinder version 16.2.1.dev13. Updating cinder to the latest version solved the issue

WSO2 analytics server database is growing

I am using WSO2 API Manager along with it's analytics server. I configured MySQL as it's database.
After a year of PROD use, I found that there are couple of tables from Analytics module, which consumes most of the DB space, around 95%.
Would like to know the significance of these tables. As well the challenges if we delete those tables.
Table names are
+--------------------------------+------------------------------------------------------+------------+
| Database | Table | Size in MB |
+--------------------------------+------------------------------------------------------+------------+
| wso2_analytics_event_store | anx___7lsekeca_ | 665.03 |
| wso2_analytics_event_store | anx___7lmnf2xa_ | 638.00 |
| wso2_analytics_event_store | anx___7lqcf_8o_ | 636.14 |
| wso2_analytics_event_store | anx___7lmk3tr0_ | 398.13 |
| analytics_processed_data_store | anx___7lpteea4_ | 282.75 |
| analytics_processed_data_store | anx___7lsn7ita_ | 249.97 |
| wso2_analytics_event_store | anx___7lsgqyce_ | 209.25 |
| wso2_analytics_event_store | anx___7lmno15m_ | 207.25 |
| wso2_analytics_event_store | anx___7lver1fy_ | 191.16 |
You can enable data purging for analytics tables. See below section taken from the docs.
Ref: https://docs.wso2.com/display/AM220/Purging+Analytics+Data

BigQuery adding unnecessary decimals to defined STRING

I have defined a schema in BigQuery as such:
+------------------+----------+----------+
| name | type | mode |
+------------------+----------+----------+
| warehouse | INTEGER | NULLABLE |
| transaction_date | DATETIME | NULLABLE |
| style | STRING | NULLABLE |
| piece | STRING | NULLABLE |
| fabric_1 | STRING | NULLABLE |
| fabric_2 | STRING | NULLABLE |
| serial | STRING | NULLABLE |
| customer_po | STRING | NULLABLE |
| order_number | STRING | NULLABLE |
+------------------+----------+----------+
The two fields I'm focusing on are serial and order_number, which when previewed in R, look like this:
+-----------+------------------+--------+-------+-----------+----------+------------+--------------+--------------+
| warehouse | transaction_date | style | piece | fabric_1 | fabric_2 | serial | customer_po | order_number |
+-----------+------------------+--------+-------+-----------+----------+------------+--------------+--------------+
| 80 | 4/3/19 | K28300 | ARMH | ALL CHAR | NA | 8040418253 | 1486838165 | 464374 |
| 80 | 4/3/19 | K28300 | ARMH | ALL CHAR | NA | 9040542252 | 1485798731-P | 464069 |
| 80 | 4/3/19 | K28300 | ARMH | ELEG NAVY | NA | 8040355550 | 1486826068 | 464369 |
| 80 | 4/3/19 | K28300 | ARMH | ELEG NAVY | NA | 8040532364 | 1485366411-R | 464071 |
+-----------+------------------+--------+-------+-----------+----------+------------+--------------+--------------+
Within R, those two fields appear to be read as characters in the dataframe I'm uploading, which is what I'm looking for. Yet when I push the data to BigQuery, those two fields end up like such:
+-----------+------------------+--------+-------+-----------+----------+------------+--------------+--------------+
| warehouse | transaction_date | style | piece | fabric_1 | fabric_2 | serial | customer_po | order_number |
+-----------+------------------+--------+-------+-----------+----------+------------+--------------+--------------+
| 80 | 4/3/19 | K28300 | ARMH | ALL CHAR | NA | 8040418253.0 | 1486838165 | 464374.0 |
| 80 | 4/3/19 | K28300 | ARMH | ALL CHAR | NA | 9040542252.0 | 1485798731-P | 464069.0 |
| 80 | 4/3/19 | K28300 | ARMH | ELEG NAVY | NA | 8040355550.0 | 1486826068 | 464369.0 |
| 80 | 4/3/19 | K28300 | ARMH | ELEG NAVY | NA | 8040532364.0 | 1485366411-R | 464071.0 |
+-----------+------------------+--------+-------+-----------+----------+------------+--------------+--------------+
Why is this happening, and how can I change it? For reference, my code to upload it:
bqr_upload_data(projectId = "project-test",
datasetId = "orders",
tableId = "daily_orders",
upload_data = df_daily_orders,
maxBadRecords = 1000,
overwrite = TRUE)
The upload from R looks at the class of the column to decide which is the best schema for BigQuery. Try changing the class of the data frame column to string to avoid it changing it to float as what looks like is happening via something like
as.character(df$column)
Now I'm not completely sure in my answer, as I am still a beginner, but it may help you. I would add this as a comment, but I don't have enough reputation yet.
If I understood properly, you are actually doing an implicit casting - from a numerical value to a string value and BigQuery is catching the decimal point as to be sure that it's properly catching the whole value
Check here BigQuery's conversion rules - second table, FLOAT64 to String.
In your place and depending on what you need to do with the table - I would:
Recreate the table, but change the schema for serial and order_number columns to an integer type
or
Try to update the already created table with an update query - and modifying the '.0' at the end of every string value

R - Multiple search and replace based on partial match within a column of a dataframe

I have a list of publisher that looks like this :
+--------------+
| Site Name |
+--------------+
| Radium One |
| Euronews |
| EUROSPORT |
| WIRED |
| RadiumOne |
| Eurosport FR |
| Wired US |
| Eurosport |
| EuroNews |
| Wired |
+--------------+
I'd like to create the following result:
+--------------+----------------+
| Site Name | Publisher Name |
+--------------+----------------+
| Radium One | RadiumOne |
| Euronews | Euronews |
| EUROSPORT | Eurosport |
| WIRED | Wired |
| RadiumOne | RadiumOne |
| Eurosport FR | Eurosport |
| Wired US | Wired |
| Eurosport | Eurosport |
| EuroNews | Euronews |
| Wired | Wired |
+--------------+----------------+
I would like to understand how I can replicate this code I use in Power Query :
search first 4 characters
if Text.Start([Site Name],4) = "WIRE" then "Wired" else
search last 3 characters
if Text.End([Site Name],3) = "One" then "RadiumOne" else
If no match is found, then add "Rest"
It does not have to be case sensitive.
Using properCase from ifultools package and gsub, we replace everything after first word with "" i.e delete it and treat the exceptional case of Radium separtely. If you have many exceptions like Radium case, please update your post with those so that we can find a neater solution to this hack :)
library("ifultools")
siteName=c("Radium One","Euronews","EUROSPORT","WIRED","RadiumOne","Eurosport FR","Wired US","Eurosport","EuroNews","Wired")
publisherName = gsub("^Radium$","Radiumone",gsub("\\s+.*","",properCase(siteName)))
# [1] "Radiumone" "Euronews" "Eurosport" "Wired" "Radiumone" "Eurosport" "Wired"
# [8] "Eurosport" "Euronews" "Wired"

Hosts file not redirecting URL when anything is after first slash

I have a Laravel 5 installation running on my VPS which is being used as an API. This has an internal DNS URL of http://brain.#####.co.uk. I have then created a entry in my hosts file on my machine that will redirect my request to my VPS and return results back from the API. Here is my hosts files entry on my machine (I have replaced my addresses with has for security):
46.**.*.*** brain.#####.co.uk
46.**.*.*** http://brain.#####.co.uk
And the hosts file on the VPS:
127.0.0.1 brain.#####.co.uk
127.0.0.1 http://#####.co.uk
and my nGinx server block:
server {
listen 80;
server_name brain.#####.co.uk http://brain.#####.co.uk;
root /var/www/stdavids-brain/html/public/;
index index.php index.html;
sendfile off;
location / {
try_files $uri $uri/ =404;
}
location ~* \.php {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_cache off;
fastcgi_index index.php;
}
}
I have checked all the settings here and they work fine and it works fine when I run the installation in development on my local machine in a Vagrant box.
The issue I am having is when I visit the URL http://brain.#####.co.uk I get a Laravel page which is fine, but when I try to access a route http://brain.#####.co.uk/category I get a 404 error. I have used traceroute to ping the http://brain.#####.co.uk/category address and it seems like my request isn't even hitting my VPS. It hits the VPS when just http://brain.#####.co.uk is called though. I know this route exists and is working as I have it working locally.
My routes:
+--------+----------+---------------------------------+-------------------------+--------------------------------------------------------------+------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+---------------------------------+-------------------------+--------------------------------------------------------------+------------+
| | GET|HEAD | api/v1/category | api.v1.category.index | App\Http\Controllers\CategoryController#index | cors |
| | POST | api/v1/category | api.v1.category.store | App\Http\Controllers\CategoryController#store | cors |
| | GET|HEAD | api/v1/category/create | api.v1.category.create | App\Http\Controllers\CategoryController#create | cors |
| | GET|HEAD | api/v1/category/{category} | api.v1.category.show | App\Http\Controllers\CategoryController#show | cors |
| | PUT | api/v1/category/{category} | api.v1.category.update | App\Http\Controllers\CategoryController#update | cors |
| | DELETE | api/v1/category/{category} | api.v1.category.destroy | App\Http\Controllers\CategoryController#destroy | cors |
| | PATCH | api/v1/category/{category} | | App\Http\Controllers\CategoryController#update | cors |
| | GET|HEAD | api/v1/category/{category}/edit | api.v1.category.edit | App\Http\Controllers\CategoryController#edit | cors |
| | GET|HEAD | api/v1/product | api.v1.product.index | App\Http\Controllers\ProductController#index | cors |
| | POST | api/v1/product | api.v1.product.store | App\Http\Controllers\ProductController#store | cors |
| | GET|HEAD | api/v1/product/create | api.v1.product.create | App\Http\Controllers\ProductController#create | cors |
| | PUT | api/v1/product/{product} | api.v1.product.update | App\Http\Controllers\ProductController#update | cors |
| | PATCH | api/v1/product/{product} | | App\Http\Controllers\ProductController#update | cors |
| | GET|HEAD | api/v1/product/{product} | api.v1.product.show | App\Http\Controllers\ProductController#show | cors |
| | DELETE | api/v1/product/{product} | api.v1.product.destroy | App\Http\Controllers\ProductController#destroy | cors |
| | GET|HEAD | api/v1/product/{product}/edit | api.v1.product.edit | App\Http\Controllers\ProductController#edit | cors |
| | POST | api/v1/status | api.v1.status.store | App\Http\Controllers\StatusController#checkAPIStatus#store | cors |
| | GET|HEAD | api/v1/status | api.v1.status.index | App\Http\Controllers\StatusController#checkAPIStatus#index | cors |
| | GET|HEAD | api/v1/status/create | api.v1.status.create | App\Http\Controllers\StatusController#checkAPIStatus#create | cors |
| | GET|HEAD | api/v1/status/{status} | api.v1.status.show | App\Http\Controllers\StatusController#checkAPIStatus#show | cors |
| | DELETE | api/v1/status/{status} | api.v1.status.destroy | App\Http\Controllers\StatusController#checkAPIStatus#destroy | cors |
| | PATCH | api/v1/status/{status} | | App\Http\Controllers\StatusController#checkAPIStatus#update | cors |
| | PUT | api/v1/status/{status} | api.v1.status.update | App\Http\Controllers\StatusController#checkAPIStatus#update | cors |
| | GET|HEAD | api/v1/status/{status}/edit | api.v1.status.edit | App\Http\Controllers\StatusController#checkAPIStatus#edit | cors |
| | GET|HEAD | images/{file} | | App\Http\Controllers\ImageController#getImage | |
| | POST | login | | App\Http\Controllers\AuthenticateController#authenticate | cors |
| | GET|HEAD | restricted | | App\Http\Controllers\AuthenticateController#restricted | |
| | POST | signup | | App\Http\Controllers\AuthenticateController#signup | cors |
+--------+----------+---------------------------------+-------------------------+--------------------------------------------------------------+------------+
Can anyone see what is going wrong here and offer advice?
Thanks

Resources