Windows Server TechCenter > Windows Server Forums > Windows Server 2008 R2 Hyper-V > Change IP adress in GuestVM by hyper-v host using powershell command
Ask a questionAsk a question
 

AnswerChange IP adress in GuestVM by hyper-v host using powershell command

Answers

  • Wednesday, November 04, 2009 9:36 PMBrianEhMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You would have to execute the command against the VM operating system.
    As the IP is either given through DHCP with a MAC address reservation, or randomly assigned.

    Setting a static IP is performed within the OS of the VM itself.

    The other option is that you have some type of agent that runs within the VM and it is actually this agent that you are invoking to set the IP address to a static IP address.

    What you are asking sounds very familiar to a new feature of a competing platform.  ;-)
    That actually operates using the last option that I mention.


    Brian Ehlert (hopefully you have found this useful)
  • Thursday, November 05, 2009 2:49 AMMervyn ZhangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Carazato,

    As Brian explained, you have to use script to remotely change VM IP Address as configuring Physical Machines.

    EnableStatic Method of the Win32_NetworkAdapterConfiguration Class
    http://msdn.microsoft.com/en-us/library/aa390383(VS.85).aspx

    Hyper-V KVP component support data exchange between Host and VMs, but it doesn’t support configuring VMs directly. For your reference:

    Hyper-V Script: Looking at KVP GuestIntrinsicExchangeItems
    http://blogs.msdn.com/virtual_pc_guy/archive/2008/11/18/hyper-v-script-looking-at-kvp-guestintrinsicexchangeitems.aspx

    How to get vm ip address in Hyper V ?
    http://social.technet.microsoft.com/Forums/en-US/winserverhyperv/thread/bd8d965a-4fcc-43ff-a66c-40630c63ef73/?prof=required&wa=wsignin1.0

    If you have difficulty to customize the script, I suggest that you initial a new post in The Official Scripting Guys Forum! to get further support there. They are the best resource for scripting related problems.

    The Official Scripting Guys Forum!
    http://social.technet.microsoft.com/Forums/en-US/ITCG/threads

    Thanks.

    Mervyn
    TechNet Subscriber Support in forum
    If you have any feedback on our support, please contact tngfb@microsoft.com 
    This posting is provided "AS IS" with no warranties, and confers no rights.

All Replies

  • Wednesday, November 04, 2009 9:36 PMBrianEhMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You would have to execute the command against the VM operating system.
    As the IP is either given through DHCP with a MAC address reservation, or randomly assigned.

    Setting a static IP is performed within the OS of the VM itself.

    The other option is that you have some type of agent that runs within the VM and it is actually this agent that you are invoking to set the IP address to a static IP address.

    What you are asking sounds very familiar to a new feature of a competing platform.  ;-)
    That actually operates using the last option that I mention.


    Brian Ehlert (hopefully you have found this useful)
  • Thursday, November 05, 2009 2:49 AMMervyn ZhangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Carazato,

    As Brian explained, you have to use script to remotely change VM IP Address as configuring Physical Machines.

    EnableStatic Method of the Win32_NetworkAdapterConfiguration Class
    http://msdn.microsoft.com/en-us/library/aa390383(VS.85).aspx

    Hyper-V KVP component support data exchange between Host and VMs, but it doesn’t support configuring VMs directly. For your reference:

    Hyper-V Script: Looking at KVP GuestIntrinsicExchangeItems
    http://blogs.msdn.com/virtual_pc_guy/archive/2008/11/18/hyper-v-script-looking-at-kvp-guestintrinsicexchangeitems.aspx

    How to get vm ip address in Hyper V ?
    http://social.technet.microsoft.com/Forums/en-US/winserverhyperv/thread/bd8d965a-4fcc-43ff-a66c-40630c63ef73/?prof=required&wa=wsignin1.0

    If you have difficulty to customize the script, I suggest that you initial a new post in The Official Scripting Guys Forum! to get further support there. They are the best resource for scripting related problems.

    The Official Scripting Guys Forum!
    http://social.technet.microsoft.com/Forums/en-US/ITCG/threads

    Thanks.

    Mervyn
    TechNet Subscriber Support in forum
    If you have any feedback on our support, please contact tngfb@microsoft.com 
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Wednesday, November 11, 2009 2:34 AMMervyn ZhangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Carazato,

    Do you need any other assistance? If there is anything we can do for you, please let us know.

    Thanks.

    This posting is provided "AS IS" with no warranties, and confers no rights.