Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
    • Application credentials
    • Authentificaton
    • Barbican (Secret)
    • CLI client (OSC)
    • Cleanup OpenStack
    • Cloud images
    • Designate (DNSaaS)
    • DevStack
    • Gerrit / OpenDev
    • Glance (image)
    • Heat
    • Horizon
    • Ironic / Bifrost
    • Magnum
    • MicroStack
    • Mistral
    • Neutron (network)
      • Address Scopes
      • Check OpenvSwitch
      • Create probe
      • Debug DHCP
      • Find router binding_host_id mismatch
      • Floating IPs
      • Ping VM from IP namespace
      • RBAC
      • port
        • Allow ping
        • Floating IP port forward
        • Recreate port
      • router
    • Object storage
    • Octavia (loadbalancer)
    • OpenStack GPU passthrough
    • OpenvSwitch (OVS)
    • Quota
    • RabbitMQ
    • VPN
    • block storage volume (cinder)
    • compute (nova)
    • control
    • diskimage-builder
    • flavor
    • gnocchi
    • kolla-ansible
    • project
    • resource provider
    • server (VM)
    • user
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid
  • openstack
  • network

Get broken / INACTIVE ports

DB_NAME=neutron
DB_USER=neutron
DB_PASS=$(grep neutron_database_password /etc/kolla/passwords.yml | cut -d " " -f2)
mysql --host=${DB_HOST} --password=${DB_PASS} --port=6033 --user=${DB_USER} --database=${DB_NAME}

select port_id, host from ml2_port_bindings where status = 'INACTIVE';
select port_id, host from ml2_port_bindings where status = 'INACTIVE' and host = 'com3-dev';
select * from ml2_port_bindings where port_id = "65db0c73-1533-4c36-9fd4-79b5e4e9704c";
#select * from ml2_port_binding_levels where port_id = "65db0c73-1533-4c36-9fd4-79b5e4e9704c" \G

# debug
PORT_IDS=$(mysql --host=${DB_HOST} --password=${DB_PASS} --port=6033 --user=${DB_USER} --database=${DB_NAME} \
  -se "select port_id from ml2_port_bindings where status = 'INACTIVE'")
echo ${PORT_IDS}

# get VMs
for PORT_ID in ${PORT_IDS}; do
    echo ${PORT_ID}
    openstack server show -c name -c "OS-EXT-SRV-ATTR:host" $(openstack port show -c device_id -f value ${PORT_ID})
done

Recreate port

SERVER_ID=f4b8828d-a717-49f6-8ad3-7b0bb1921123

nova interface-list ${SERVER_ID}

PORT_ID=57944199-014c-4907-9d6e-1fb233151234

# debug
openstack port show ${PORT_ID} -c name -c network_id -c mac_address -c fixed_ips -c security_group_ids -c project_id -c device_id

get port data

PORT_NAME=$(openstack port show ${PORT_ID} -c name -f value)
PORT_NETWORK=$(openstack port show ${PORT_ID} -c network_id -f value)
PORT_MAC=$(openstack port show ${PORT_ID} -c mac_address -f value)
PORT_IP=$(openstack port show ${PORT_ID} -c fixed_ips -f json | jq -r .fixed_ips[].ip_address)
PORT_SECURITY_GROUP=$(openstack port show ${PORT_ID} -c security_group_ids -f json | jq -r .security_group_ids[])
PORT_PROJECT=$(openstack port show ${PORT_ID} -c project_id -f value)
PORT_DEVICE=$(openstack port show ${PORT_ID} -c device_id -f value)

echo "
PORT_ID: ${PORT_ID}
PORT_NAME: ${PORT_NAME}
PORT_NETWORK: ${PORT_NETWORK}
PORT_MAC: ${PORT_MAC}
PORT_IP: ${PORT_IP}
PORT_SECURITY_GROUP: ${PORT_SECURITY_GROUP}
PORT_PROJECT: ${PORT_PROJECT}
PORT_DEVICE: ${PORT_DEVICE}
"

Re-Create port

# backup port data
openstack port show ${PORT_NAME} > /tmp/${PORT_NAME}_pre.out

# delete port
openstack port delete ${PORT_ID}

# create port
openstack port create ${PORT_NAME} \
    --network ${PORT_NETWORK} \
    --mac-address ${PORT_MAC} \
    --fixed-ip ip-address=${PORT_IP} \
    --security-group ${PORT_SECURITY_GROUP} \
    --project ${PORT_PROJECT}

# assign port
openstack server add port ${PORT_DEVICE} ${PORT_NAME}

# compare port data
openstack port show ${PORT_NAME} > /tmp/${PORT_NAME}_post.out
diff /tmp/${PORT_NAME}_pre.out /tmp/${PORT_NAME}_post.out

restart port

openstack port set --disable ${PORT_ID}
openstack port set --enable ${PORT_ID}
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung