VMware Communities > VMTN > VMware Infrastructure™ > VI: ESX 3.5 > Discussions

This Question is Answered

2 "helpful" answers available (6 pts)
11 Replies Last post: Jul 3, 2009 1:12 AM by vDeepak
Reply

Need to change ESX ip address from Static to Dynamic!

Jun 26, 2009 11:40 AM

Click to view vDeepak's profile Hot Shot vDeepak 116 posts since
May 31, 2009

While doing some R and D over ESX server i provided my ESX box as static Ip through VC server....but it fails and process gets hanged..and now am not abe to connect to ESX box through VC server.

when it was Dynamic everythng was good..so i need to change ESX ip address from static to Dynamic...and only way am able to connect to box is by ILO..

Will you please suggest the command by which i can do it?

Reply Re: Need to change ESX ip address from Static to Dynamic! Jun 26, 2009 12:01 PM
Click to view vDeepak's profile Hot Shot vDeepak 116 posts since
May 31, 2009
any update?
Reply Re: Need to change ESX ip address from Static to Dynamic! Jun 26, 2009 12:36 PM
in response to: vDeepak
Click to view @m!t's profile Enthusiast @m!t 53 posts since
Apr 8, 2008
VMware

--Create a vswitch first

esxcfg-vswitch -a <vswitch name>

esxcfg-vswitch -L <uplink > <vswitch name?

esxcfg-vswitch -A <portgroup name> vSwitch

esxcfg-vswif -a vswif0 -a <portgroup name> -i DHCP

-@m!t

Reply Re: Need to change ESX ip address from Static to Dynamic! Jun 26, 2009 1:36 PM
in response to: @m!t
Click to view vDeepak's profile Hot Shot vDeepak 116 posts since
May 31, 2009

i thnk there is somethng wrong in above command....its -a and -A i suppose in last line...

i created the switch and port group for service console and now need to assign that port group to DHCP..

Please suggest .

Reply Re: Need to change ESX ip address from Static to Dynamic! Jun 26, 2009 3:25 PM
in response to: vDeepak
Click to view RParker's profile Champion RParker 5,270 posts since
Dec 6, 2006
http://communities.vmware.com/message/437878

It would appear the best way to do it is simply delete the SC, and create a new one with a DHCP address.
Reply Re: Need to change ESX ip address from Static to Dynamic! Jun 26, 2009 11:20 PM
in response to: vDeepak
Click to view @m!t's profile Enthusiast @m!t 53 posts since
Apr 8, 2008
VMware

See the command help for option:

Esxcfg-vswitch
Description: Creates and updates virtual machine (vswitch) network settings
Syntax: esxcfg-vswitch <options> [vswitch:ports]

Options:

-a Add a new virtual switch.
-d Delete the virtual switch.
-l List all the virtual switches.
-L <pnic> Set pnic as an uplink for the vswitch.
-U <pnic> Remove pnic from the uplinks for the vswitch.
-p <portgroup> Specify a portgroup for operation. Use ALL for operation to work on all portgroups
-v <vlan id> Set VLAN ID for portgroup specified by -p. 0 would disable the VLAN.
-c Check to see if a virtual switch exists. Program outputs a 1 if it exists, 0 otherwise.
-A <name> Add a new portgroup to the virtual switch.
-D <name> Delete the portgroup from the virtual switch.
-C <name> Check to see if a portgroup exists. Program outputs a 1 if it exists, 0 otherwise.
-r Restore all virtual switches from the configuration file (Internal use only)
-h Displays command help

Reply Re: Need to change ESX ip address from Static to Dynamic! Jul 1, 2009 12:58 AM
in response to: @m!t
Click to view vDeepak's profile Hot Shot vDeepak 116 posts since
May 31, 2009
Parker: am going through the post suggested by you and will back to you shortly.

Amit: meanwhile am following the way suggested by you...i had deleted my all virtual switches over esx and now am logging to esx through ILO and created a new virtual switch with esxcfg-vswitch -a vswitch0 command and then i tried to create port group over this cirtual switch and i used esxcfg-vswitch -A "service console" vswitch0 command and am able to see that with esxcfg-vswitch -l command .

I hope that service console is created..but i dnt know how to provide the port group "service console " Ip address as to take frm DHCP.

As whn am trying to use command esxcfg-vswif -l comamnd am getting simply :

--root@server root--# esxcfg-vswif -l

name port group ip adress netmask broadcast enabled DHCP

and nothng below these names...its blank..so i suppose smthg more to configure.

Apart from this will you please also answer my another question:

1. whats diff. between creating service console port by command : esxcfg-vswitch -A "service console" vswitch0 and esxcfg-vswitch -p "Service Console" vSwitch0 ?

2. Whats diff. between esxcfg-vswitch and vswif?

Also output of command :

esxcfg-vswitch -p "Service Console" vSwitch0 gives bad command in this scenario!

i had just started doing all through command prompt..so new is this arena http://communities.vmware.com/images/emoticons/sad.gif

Reply Re: Need to change ESX ip address from Static to Dynamic! Jul 1, 2009 10:28 PM
in response to: vDeepak
Click to view vDeepak's profile Hot Shot vDeepak 116 posts since
May 31, 2009


First delete all your vswitches and vswif with these commands:

esxcfg-vswif -d vswif0

and then...

esxcfg-vswitch -d <vswitch name>

and then create the new one and new port group as follows:

My problem is solved now...

i followed following steps:

sxcfg-vswitch -a <vswitch name>


esxcfg-vswitch -L <uplink NIC name> <vswitch name


esxcfg-vswitch -A <portgroup name> vSwitch


esxcfg-vswif -a vswif0 -p <portgroup name > -i DHCP

This above method is cent percent perfect and it resolved my issue :)


Reply Re: Need to change ESX ip address from Static to Dynamic! Jul 1, 2009 10:30 PM
in response to: vDeepak
Click to view vDeepak's profile Hot Shot vDeepak 116 posts since
May 31, 2009

my problem is yet solved but still am looking for answer:

whats the diff between vswif and vswitch...as far i knw vswif is for creating service console port...will you guys put more stress over it?

Also whats the diff between creating the service console port group and creating new vswif?

also the diff between creating service console with -p and -A command

Reply Re: Need to change ESX ip address from Static to Dynamic! Jul 3, 2009 12:59 AM
Click to view tom howarth's profile Guru tom howarth 7,299 posts since
Jul 25, 2005
Moderator
Read my blog post on the subject http://planetvm.net/blog/?p=423

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

Tom Howarth VCP / vExpert
VMware Communities User Moderator
Blog: www.planetvm.net
Contributing author for the upcoming book "VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment”. Currently available on roughcuts

Reply Re: Need to change ESX ip address from Static to Dynamic! Jul 3, 2009 1:01 AM
in response to: vDeepak
Click to view tom howarth's profile Guru tom howarth 7,299 posts since
Jul 25, 2005
Moderator
a vSwitch is a switch and vswif is a effectively a portgroup on that switch.

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

Tom Howarth VCP / vExpert
VMware Communities User Moderator
Blog: www.planetvm.net
Contributing author for the upcoming book "VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment”. Currently available on roughcuts

Reply Re: Need to change ESX ip address from Static to Dynamic! Jul 3, 2009 1:12 AM
in response to: tom howarth
Click to view vDeepak's profile Hot Shot vDeepak 116 posts since
May 31, 2009
Thanks Tom!
Actions