Comments (6)
Hello,
Hyper-V doesn't actually handle IP addresses, it only supports reading the value that the operating system has assigned to the virtual adapter. There's no way for the hypervisor to set this value, only the OS.
You can read and change the MAC address, as that's the hardware address, but the IP is handled on the operating system level and there's no method for Hyper-V to interfere there.
from fog-hyperv.
from fog-hyperv.
To connect to Hyper-V VMs before they have a running OS, you will RDP to the VM host and use the correct parameter for Hyper-V to pass the RDP connection on into the VM console.
https://superuser.com/questions/685968/directly-accessing-hyper-v-console-via-rdp - the answer contains information both for connecting with vmconnect and RDP on Windows, as well as FreeRDP otherwise.
If you - on the other hand - actually need to connect directly to the VM itself, then you will need to let it boot, have it install and run an operating system, let it get an IP address from your DHCP server, and then connect to that IP address.
from fog-hyperv.
from fog-hyperv.
What you will want to do for your use-case would be to set the VM's MAC address in your DHCP server to give it a fixed IP address.
Hyper-V is a regular hypervisor, one that only deals with the virtualization of hardware. The IP address that a running machine acquires isn't able to be decided by the network hardware, it's done on the OS level - either with a client that talks DHCP to get a lease on an address, or by statically configuring an IP address on the interface. Either way, Hyper-V is only able to affect the virtualized hardware itself, and the network adapter hardware itself doesn't have any say in this particular regard.
If other providers - cloud or not - allow for configuring the IP on a virtual machine inside of them, it's most likely done by them running a DHCP server internally which the VM will end up receiving the IP from. Or they're relying on the installation of VM tools, which would let the virtual machine communicate directly with the hypervisor to read a requested IP config and apply it on the OS level.
For my foreman_hyperv plugin, your scenario is done by; the user entering an IP in the Foreman interface when creating a host, a VM is then created in Hyper-V, launched for a second, before then being killed again so that Hyper-V has to generate a MAC address for it, then reconfigured to have that MAC address assigned statically to the adapter. After that, the DHCP server has an entry orchestrated to fix the chosen address to the generated MAC address, which the VM will then pick up when it next boots and runs a DHCP request.
from fog-hyperv.
from fog-hyperv.
Related Issues (20)
- Do logging properly
- Support VM Snapshots as well
- VHD paths shouldn't break if a VM has a checkpoint
- Support boot order changes on generation 2
- Always support executing commands on computers other than the first hop HOT 1
- Figure out a better way to handle clustering
- Add VLAN support for network adapters HOT 2
- Hosted collections don't pass through host parameters correctly
- Missing set_vm_network_adapter_vlan.rb HOT 2
- State not recognized correctly HOT 10
- error when examine VM on hyper-v HOT 2
- Case sensitive MAC Address HOT 3
- Implement cluster support
- Don't pass around option hashes all over the place
- Grab a VM object where possible, to avoid having to do name lookups
- Use argument splatting HOT 2
- Raise exceptions on missing required arguments on requests
- Detect Hyper-V version for using newer cmdlets HOT 1
- Set up tests and mocks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fog-hyperv.