devstack远程代码调试

前言

  • devstack安装完毕
  • 本地安装vscode,依赖插件remote-ssh

vscode远程连接

  1. 下载remote-ssh

    Pasted image 20220511095532.png

  2. 配置远程环境


    Pasted image 20220511095631.png
Pasted image 20220511095800.png
  1. 配置如下:IdentityFile需要在devstack的/home/stack/.ssh/authorized_keys
Host devstack
HostName 10.167.47.47
User stack
port 22
TCPKeepAlive yes
ServerAliveInterval 30
IdentityFile ~/.ssh/id_rsa
  1. 打开ssh-remote选择devstack


    Pasted image 20220511100723.png
  2. 以glance(镜像服务为例),打开项目源码
    Pasted image 20220511100846.png
  3. 下载remote_pdb,sudo pip install remote_pdb

  4. 打断点,以获取镜像列表举例
    Pasted image 20220511101100.png
  1. 重启服务生效断点 sudo systemctl restart [email protected]

  2. 查看监听端口 sudo journalctl -f --unit devstack@g-api

    Pasted image 20220511101246.png

  3. 请求接口,进行调试


    Pasted image 20220511101415.png

你可能感兴趣的:(devstack远程代码调试)