VMware
12 Replies Last post: Oct 31, 2006 6:19 AM by BigBadJohnnyB  

Changing a Service Console IP? posted: Jul 17, 2006 11:22 AM

Click to view Rob.Bohmann's profile Master 583 posts since
May 31, 2005
It appears that you cannot change an existing ESX's Service Console IP address. I built a machine on a test segment using DHCP and now I want to assign it a static ip. Using the esxcfg-vswif -i command allowed me to assign it a differerent ip, but the server is not on the network, not pingable and is not resolving names - but can ping ips when specified correctly. Looking at TFM... I read <p.23 of the Server config guide> "When only one service console connection is present (yep), changing the service console configuration is not allowed. If you want a new connection (nope!), you must change the network settings to use an additional nic. After verifying it works, remove the old setting..... "
Well the command I ran allowed me to change the setting and when i run esxcfg-vswif -l it shows the address I put in, but it doesn't work. Same segment, netmask, broadcast, just a static address instead of using DHCP.

Since this is how we frequently build new servers, starting with DHCP and then assigning a static for longer term testing or moving server to prod segment, I am looking for an easy way to just switch the service console ip. Now I guess I could add a 2nd connection, config a service console, and do the whole switcharoo thingagetjiggy with it, but I am trying to avoid that if possible. I guess it would be possible to add the 2nd console to the 1st vswitch and then remove the original one. I was hoping to find a way to do this without using Virtual Center.

Re: Changing a Service Console IP?

1. Jul 19, 2006 12:59 PM in response to: Rob.Bohmann
Click to view eliot's profile Hot Shot 145 posts since
Sep 29, 2005
I think its to do with the firewall. on 2.x it was quite straightforward to change the IP - I used the same procedure on a esx3 box that I built with the wrong IP and it just didn't work - i was in a hurry, so I just flattened it and started again. I cant remember the conf file that holds to iptables, but that would be my starting point.

Re: Changing a Service Console IP?

2. Jul 19, 2006 1:15 PM in response to: Rob.Bohmann
Click to view formulator's profile Hot Shot 107 posts since
Aug 18, 2005
check ip that's assigned with "/sbin/ifconfig" from the console, if you need to reassign the address try "/sbin/ifconfig <service console interface name> <ip here> netmask <mask here>". check contents of "/etc/resolv.conf" for nameservers and "/etc/sysconfig/network" for your defauly gateway.

Also might want to check out the contents of "/etc/sysconfig/network-scripts/ifcfg-<service console interface name>" to see what will be applied after a reboot.

Re: Changing a Service Console IP?

3. Jul 25, 2006 4:38 PM in response to: Rob.Bohmann
Click to view noahj's profile Hot Shot 271 posts since
Oct 28, 2004
Here is how I did it.

Go into Virtual Center, higlight the host you want to change and click on the configuration tab.

In the hardware box on the left side click Networking.

Find your Service console in the list on the Right. Click on properties.

Under the vSwitchX properties click on the Add button On the Ports Tab.

For Connection Type Choose Service Console.

On Connection settings Label it what you want so long as it is different than the Initial service console. Set your VLANID if needed. Then set the IP address to the Address you wish to change it to.

Click Next and after validating the setup click finish.

Under the vSwitchX properties click on the Service Console and click Edit.
Next to Service Console Default gateway click Edit.

Ensure that the gateway is correct, change it if it is not. Then Next to Gateway Device change it to the new VSWIF that you just created. (On my system is was VSWIF1 for example.)

When you click Ok the server will lose connection. This is normal. Ensure that your DNS is updated to reflect the correct name and update your DNS on your Virtual Center host so that it pings the server. I also restarted the virtual center service to ensure that it started with fresh information about the host IP. After that, it all worked perfectly. I deleted the original Service console and Rename the new one to "Service Console".

A little bit of a heart stopper but overall, very successful. This was done from my conputer in Portland Oregon to a server in the Carolinas. All remote, never touched the actual console of the host and it is functioning as expected. Hope this helps!

Re: Changing a Service Console IP?

4. Jul 25, 2006 11:00 PM in response to: noahj
Click to view eliot's profile Hot Shot 145 posts since
Sep 29, 2005
In my case, i wasn't able to access gui due to the incorrect IP.

Re: Changing a Service Console IP?

5. Jul 27, 2006 1:03 AM in response to: noahj
Click to view virtech's profile Master 935 posts since
Jan 10, 2006
There is a slightly easier way to do this from the VI Client

Select networking from the configuration tab.

Select the properties of the service console connection

Click on the Add button under the ports tab

Select service console, use a different name like service console 1

Enter an ip address (different from your original service console address), subnetmask etc., then click next and finish.

Highlight the original Service Console connection, click edit, change the ipaddress to what ever you want.

You will be disconnected from Virtual Center.

Once reconnected delete service console1

Re: Changing a Service Console IP?

6. Aug 5, 2006 12:03 PM in response to: virtech
Click to view jhanekom's profile Master 1,084 posts since
May 13, 2005
Just been through this excercise myself and searched the forums in the hope that I'd find an answer. (Couldn't access the box due to wrong IP, so reconfiguring through VI wasn't an option.)

I can confirm that simply changing the IP address through esxcfg-vswif is only part of the story; the IP address is changed, but you cannot access the machine through the VI client or through HTTP. (You can SSH to it and ping it, though.)

"netstat -an" confirms that the server is not listening on port 80 or 443.

The solution is to do the same on the console as what others have suggested for the VI client or Virtual Center: remove the vswif0 object using esxcfg-vswif, then re-add it.

For example: esxcfg-vswif -d vswif0
Then: esxcfg-vswif -a vswif0 -p Service\ Console -i 10.0.0.10 -n 255.255.255.0 -b 10.0.0.255 vswif0

Edit: you need to reboot after running esxcfg-vswif -d, otherwise the addition doesn't seem to work properly.

Message was edited by:
jhanekom

Re: Changing a Service Console IP?

7. Aug 15, 2006 9:01 PM in response to: jhanekom
Click to view joepje's profile Expert 487 posts since
Jun 21, 2005
after the deletion you can try to restart the managment agent:

service mgmtvmware restart

maybe a reboot less ;-)

Re: Changing a Service Console IP?

8. Sep 8, 2006 10:08 AM in response to: Rob.Bohmann
Click to view selliott's profile Novice 13 posts since
Mar 9, 2006
There is a *great* guide out there that covers the command line utilities "big boys" : http://www.rtfm-ed.co.uk/?page_id=7

In particular, there is a specific section on changing your service console IP address; here is a quick summary:

esxcfg-vswif -i new.ip.add.here -n new.sub.net.mask -b new.broad.mask.here vswif0

restart the managment software using this: service mgmt-vmware restart

Change the default gateway by editing /etc/sysconfig/network
restart your network services using this: service network restart

And you should be off to the horse races. Worked like a charm for me, any way.

Re: Changing a Service Console IP?

9. Sep 19, 2006 9:19 AM in response to: selliott
Click to view jbruelasdgo's profile Master 854 posts since
Dec 22, 2004
The guide contains useful info for service console commands.

it worked like a charm for me too!!!

reference: http://www.rtfm-ed.eu/docs/vmwdocs/esx3.x-vc2.x-serviceconsole-guide.pdf

hope it could be useful for you too!

best regards

Jose Ruelas

Re: Changing a Service Console IP?

10. Oct 18, 2006 9:13 AM in response to: virtech
Click to view kellino's profile Hot Shot 161 posts since
Aug 29, 2005
It sounds like I have the right procedure to change the service console.

I added the new service console and I can connect to it using the VI client.

However, when I try to delete the old service console -- even if connecting to the SC using the NEW IP address in the VI Client -- I get an error that the resource is in use and I can't delete the old service console.

Re: Changing a Service Console IP?

11. Oct 19, 2006 3:50 PM in response to: jbruelasdgo
Click to view BigJon's profile Novice 35 posts since
Nov 8, 2004
I couldn't get mine to work. After spending an hour and a half on the console trying these commands, I realized it would be much easier to just reload ESX. I hope that Vmware changes all of the commands again when ESX 4 comes out. Won’t want to use any prior product knowledge, would we?

Re: Changing a Service Console IP?

12. Oct 31, 2006 6:19 AM in response to: jhanekom
Click to view BigBadJohnnyB's profile Enthusiast 39 posts since
May 2, 2006
<quote>
For example: esxcfg-vswif -d vswif0
Then: esxcfg-vswif -a vswif0 -p Service\ Console -i 10.0.0.10 -n 255.255.255.0 -b 10.0.0.255 vswif0
</quote>

This works perfectly with two tweaks -

1) the vswif0 at the end breaks the command. Should read:
esxcfg-vswif -a vswif0 -p Service\ Console -i 10.0.0.10 -n 255.255.255.0 -b 10.0.0.255

2) the post below states you might be able to save a reboot my restarting the mgmt service - this DOES work!

/etc/init.d/mgmt-vmware restart

Thank you so much!!! solved my problem!

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities