Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DHCP in Virtual Router is not working #8451

Closed
li-liwen opened this issue Jan 5, 2024 · 7 comments
Closed

DHCP in Virtual Router is not working #8451

li-liwen opened this issue Jan 5, 2024 · 7 comments

Comments

@li-liwen
Copy link

li-liwen commented Jan 5, 2024

ISSUE TYPE
  • Bug Report
COMPONENT NAME
VR, DHCP
CLOUDSTACK VERSION
4.18.1
CONFIGURATION
OS / ENVIRONMENT

N/A

SUMMARY

VMs are not able to acquire IP address from the virtual router.

STEPS TO REPRODUCE
1. Fresh installation of cloudstack 4.18.1 with advanced zone
2. Download a Ubuntu server ISO or Ubuntu cloud image.
3. Create a VPC and isolated network under the VPC.
4. Boot the cloud image or ISO.
5. Connect the console and try to acquire IP address through DHCP.
EXPECTED RESULTS
The VM successfully get the IP address that matches the IP address in the UI.
ACTUAL RESULTS
The VM can't acquire the IP address automatically, but if I set the IP manually, the VM is able to function properly.
(Port forwarding, DNS, and internet routing are all working)
The dhcp_check.py in the UI is showing OK, but DHCP is not working properly.
截屏2024-01-05 14 48 42 截屏2024-01-05 14 47 26
@DaanHoogland
Copy link
Contributor

@li-liwen , this is just how VPCs and isolated networks work. CloudStack administers ip addresses for client VMs, not the VR.
Maybe you can rephrase this as a feature request if it is really needed. It seems to me that assigning the allocated IP is not that big off a deal though.

@weizhouapache
Copy link
Member

@li-liwen , this is just how VPCs and isolated networks work. CloudStack administers ip addresses for client VMs, not the VR. Maybe you can rephrase this as a feature request if it is really needed. It seems to me that assigning the allocated IP is not that big off a deal though.

@DaanHoogland
As I understand, what the author said is, the VM cannot get the DHCP IP (from dhcp server/cloudstack VR) when boot from the ISO or ubuntu image.
from what he said, the network configuration seems to be correct.
I created a image from pfsense ISO recently, it worked well.

@li-liwen
can you try

  • same iso/image , but on an isolated network (not vpc tier) ?
  • other iso/images on vpc tiers ?

@li-liwen
Copy link
Author

li-liwen commented Jan 5, 2024

Thank you all for the quick reply. I am relatively new to cloudstack and cloud environments, so please correct me if I have any misunderstanding.

@li-liwen , this is just how VPCs and isolated networks work. CloudStack administers ip addresses for client VMs, not the VR. Maybe you can rephrase this as a feature request if it is really needed. It seems to me that assigning the allocated IP is not that big off a deal though.

@DaanHoogland I can see that the Cloudstack has assigned the IP address to the instance in the WebUI. But I suppose that VR will use DHCP to automatically assign the IP address to the VM? As I plan to use cloud images with ssh keys (no default password), it would be impossible to assign IP address manually after the instance has been created. If there is a way to assign the IP address through cloud-init config file that is transparent to the users (e.g. vendor config?), I think it would also be acceptable.

@li-liwen can you try

  • same iso/image , but on an isolated network (not vpc tier) ?
  • other iso/images on vpc tiers ?

@weizhouapache I have tried creating an isolated network with no VPC, but still the same result. (Not getting IP address through DHCP, but everything works fine after manual assigning through console.
I have also tried a windows server 2022 eval iso installation, still not getting IP address automatically through DHCP. I suppose that there should be some problems in the DHCP module inside the virtual router VM, but I didn't find any information on how to debug the DHCP module.

Please help me if you have any idea on how to debug. Or if there's any more information or logs I should provide, please tell me. Thanks.

@weizhouapache
Copy link
Member

Thank you all for the quick reply. I am relatively new to cloudstack and cloud environments, so please correct me if I have any misunderstanding.

@li-liwen , this is just how VPCs and isolated networks work. CloudStack administers ip addresses for client VMs, not the VR. Maybe you can rephrase this as a feature request if it is really needed. It seems to me that assigning the allocated IP is not that big off a deal though.

@DaanHoogland I can see that the Cloudstack has assigned the IP address to the instance in the WebUI. But I suppose that VR will use DHCP to automatically assign the IP address to the VM? As I plan to use cloud images with ssh keys (no default password), it would be impossible to assign IP address manually after the instance has been created. If there is a way to assign the IP address through cloud-init config file that is transparent to the users (e.g. vendor config?), I think it would also be acceptable.

@li-liwen can you try

  • same iso/image , but on an isolated network (not vpc tier) ?
  • other iso/images on vpc tiers ?

@weizhouapache I have tried creating an isolated network with no VPC, but still the same result. (Not getting IP address through DHCP, but everything works fine after manual assigning through console.
I have also tried a windows server 2022 eval iso installation, still not getting IP address automatically through DHCP. I suppose that there should be some problems in the DHCP module inside the virtual router VM, but I didn't find any information on how to debug the DHCP module.

Please help me if you have any idea on how to debug. Or if there's any more information or logs I should provide, please tell me. Thanks.

@li-liwen
Can you test with the built-in centos 5.5?

@li-liwen
Copy link
Author

li-liwen commented Jan 7, 2024

@weizhouapache Thank you for you advice. It turns out that the cloud images can get IP address properly after configure the firewall of the VR properly (I guess through cloud-init?). However, the ISO image (both ubuntu and windows) can't get IP address through DHCP. I tested the ISO image in both VPC and isolated network, neither of them is working. I am wondering is that the supposed behavior? Or I should do further debugging? Thanks.

@weizhouapache
Copy link
Member

@weizhouapache Thank you for you advice. It turns out that the cloud images can get IP address properly after configure the firewall of the VR properly (I guess through cloud-init?). However, the ISO image (both ubuntu and windows) can't get IP address through DHCP. I tested the ISO image in both VPC and isolated network, neither of them is working. I am wondering is that the supposed behavior? Or I should do further debugging? Thanks.

what rules did you add in the VR?

@li-liwen
Copy link
Author

li-liwen commented Jan 7, 2024

@weizhouapache Thank you for you advice. It turns out that the cloud images can get IP address properly after configure the firewall of the VR properly (I guess through cloud-init?). However, the ISO image (both ubuntu and windows) can't get IP address through DHCP. I tested the ISO image in both VPC and isolated network, neither of them is working. I am wondering is that the supposed behavior? Or I should do further debugging? Thanks.

what rules did you add in the VR?

@weizhouapache I first used the cloud image and set the port forwarding for ssh. I didn't configure the Egress rule so I can't connect to the instance through ssh. As cloud image doesn't have default password, I cannot login through the console. I tried an ISO image but failed to get address through DHCP. After configuring the egress rule, I was able to connect the cloud image instance through ssh. But I was still unable to get ip address through DHCP in the ISO booted instance.

However, I tried a Windows ISO image today, and it acquired the IP address successfully. I am not sure what I have configured to make it working, but it just worked today. I was trying to resolve #8252 this issue and changed all my compute offering from 2.3GHz to 100MHz. I can't remember I did any other configuration since that day. Although quite curious, I believe the problem is resolved. Thank you for your help. If I have any misunderstanding or misconfiguration, please correct me. If everything seems ok, the issue can be closed.

@DaanHoogland DaanHoogland added this to the unplanned milestone Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants