VMware Cloud Community
jasonboche
Immortal
Immortal
Jump to solution

vimsh: change vmnic from standby to active

Have you been able to use vimsh to change standby NICs into active NICs?

I can use vimsh to set NICs from active to standby, but I can’t do the reverse: take a standby NIC and make it active

Each time I try to make a standby vmnic active, I’m greeted with “A specified parameter was not correct”

Thank you,

Jas






[i]Jason Boche[/i]

[VMware Communities User Moderator|http://communities.vmware.com/docs/DOC-2444][/i]

VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
0 Kudos
33 Replies
glynnd1
Expert
Expert
Jump to solution

stumpr,

I'm having an issue with the loop sample you show. I'm attempting to use it in my kickstart script, which spawns a script to run on first boot, where I use the loop to wait before I start configuring network settings. Just like the others in this thread. However in my case it just loops for ever, or so it seems, as I have a screen full of 20 second waits echoed.

So, am I using it correctly?

Thanks

0 Kudos
stumpr
Virtuoso
Virtuoso
Jump to solution

Can you post your script and any error messages you're seeing? We could adopt it with a maximum loop count so it doesn't run infinite, but since it just checks to see if vim is returning data it's either a syntax error or something bigger is at issue.

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
glynnd1
Expert
Expert
Jump to solution

Attached is the kickstart script I am building. I've pared it down to just the networking stuff, as I gathered this is what has changed the most since 3.0.2 and hence what I need to change. It is pretty much line for line what others have posted in this thread.

Only strange thing I am doing is installing on a Dell desktop, purely for conviencetestin/debug. The production servers are HCL hardware.

No error messages are posted to the screen, it just keeps looping...I shall go digging for logfile.

0 Kudos
stumpr
Virtuoso
Virtuoso
Jump to solution

Looks ok. You can set the sleep to something like 2 or 5 seconds. I created that little loop just to avoid having to guess the time needed for the mgmnt daemon to start.

You should see any output from the script in /var/log/messages IIRC. Are you sure the mgmnt service is even starting? I never put a timeout on the loop, so it will loop forever if the mgmnt service doesn't startup.

You could remove the loop and then just log in after the post-install. Then see if the mgmnt service can be started manually.

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
glynnd1
Expert
Expert
Jump to solution

Getting the log files took a little while, but at least I know why it was hanging.

Jul 2 11:26:51 dco-es24 vmkstart:

Jul 2 11:26:51 dco-es24 rc: Starting vmkstart: succeeded

Jul 2 11:26:54 dco-es24 esxcfg-linuxnet: Success!

Jul 2 11:27:05 dco-es24 rc: Starting vmware-webAccess: succeeded

Jul 2 11:26:54 dco-es24 vmware: Setting up Service Console networking succeeded

Jul 2 11:26:54 dco-es24 vmware: Skipping VMware ESX Server services. succeeded

Jul 2 11:26:54 dco-es24 rc: Starting megaraid_sas_ioctl: succeeded

Jul 2 11:26:54 dco-es24 rc: Starting mptctlnode: succeeded

Jul 2 11:26:55 dco-es24 firewall: Starting firewall succeeded

Jul 2 11:27:06 dco-es24 crond: crond startup succeeded

Jul 2 11:26:55 dco-es24 sysctl: net.ipv4.ip_forward = 0

Jul 2 11:26:55 dco-es24 sysctl: net.ipv4.conf.default.rp_filter = 1

Jul 2 11:27:07 dco-es24 mgmt-vmware: Skipping VMware ESX Server Management services. succeeded

Jul 2 11:26:55 dco-es24 sysctl: kernel.core_uses_pid = 1

Jul 2 11:26:55 dco-es24 sysctl: kernel.core_pattern = /var/core/%p.core

Jul 2 11:26:55 dco-es24 sysctl: fs.file-max = 32768

Jul 2 11:26:55 dco-es24 sysctl: net.ipv4.conf.default.arp_filter = 1

Jul 2 11:26:55 dco-es24 network: Setting network parameters: succeeded

Jul 2 11:26:56 dco-es24 network: Bringing up loopback interface: succeeded

Jul 2 11:26:58 dco-es24 network: Bringing up interface eth0: succeeded

Jul 2 11:26:59 dco-es24 network: Bringing up interface vswif0: succeeded

Now why it is doing that would be the interesting tidbit.

0 Kudos
stumpr
Virtuoso
Virtuoso
Jump to solution

I found the message in the init scripts. It's picking up the troubleshoot (tblsht) kernel option.

Are you starting it in Service Console Only mode? Post up your /boot/grub/grub.conf.

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
glynnd1
Expert
Expert
Jump to solution

I was getting stuck in the loop on all three grub menu options, attached is my grub.conf as requested.

0 Kudos
glynnd1
Expert
Expert
Jump to solution

Stumpr, this may be an issue with the hardware (GX270 desktop) I've been using for testing my ks script. It works fine, looping six times, an a 1850.

While trying to debug it I pulled in one of the Linux heads here who tweaked the looping just a little, replacing the 'until' with a 'while' and dropping the grep. Same functionality just a religous differance of opinion, I gather.

echo "Waiting 20 seconds for mgmt-vmware service to start" | tee -a /tmp/install.log

while ! vmware-vim-cmd /hostsvc/runtimeinfo; do

sleep 20

echo "Waiting another 20 seconds for mgmt-vmware service to start" | tee -a /tmp/install.log

done

Thanks for your help on this and publishing your solution in the first place.

0 Kudos
stumpr
Virtuoso
Virtuoso
Jump to solution

Yeah, just a difference. They're log outputs are an improvement to mine though Smiley Happy I didn't want to rely on the return value of the command, I wanted valid data as well, but it should (and appears) to be just as effective.

Guess the mgmnt service just would not start on non-supported hardware then? Interesting. Though I've never tried my scripts outside of supported hardware or my workstation ESX test vms.

Glad you got it working.

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
vmpert
Contributor
Contributor
Jump to solution

Hi jason,

do you know a way to set a vmnic in standby for a portgroup instead of the vswitch?

thx and rgds

0 Kudos
stumpr
Virtuoso
Virtuoso
Jump to solution

vmware-vim-cmd /hostsvc/net/portgroup_set --nicorderpolicy-standby=vmnic# vSwitch# PortGroupName.

The --nicorderpolicy-standby is what you need.

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
vmpert
Contributor
Contributor
Jump to solution

Thy for your respond.

I entered the command: vmware-vim-cmd /hostsvc/net/portgroup_set --nicorderpolicy-standby=vmnic0 vSwitch0 "VMotion"

..and the error:

(vmodl.fault.InvalidArgument) {

dynamicType = ,

msg = "A specified parameter was not correct.

"

}

..any idea what wrong with the syntax?

0 Kudos
glynnd1
Expert
Expert
Jump to solution

vpert,

I know I went through a lot of pain getting this to work, and while I know don't recall all the illogical decisions behind what I ended up with I do have the resulting script. This snipit is todo with configuring vSwitch0 for the Service Console and VMotion, the comments should cover the rest.

echo "Configuring vSwitch0 for two NICs supporting Service Console & VMotion in an active/standby & standby/active"

echo "Adding second NIC to vSwitch0"

esxcfg-vswitch -U vmnic0 vSwitch0

vmware-vim-cmd internalsvc/refresh_network

esxcfg-vswitch -L vmnic0 vSwitch0

esxcfg-vswitch -L vmnic2 vSwitch0

echo "Creating VMotion portgroup"

esxcfg-vswitch --add-pg VMotion vSwitch0

esxcfg-vswitch --vlan 473 --pg VMotion vSwitch0

echo "Configuring VMotion IP setting"

esxcfg-vmknic --add VMotion --ip 10.142.173.1XXXX --netmask 255.255.255.0

echo "Enabling VMotion"

vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0

vmware-vim-cmd internalsvc/refresh_network

echo "Setting Service Console portgroup to active/standby"

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-active vmnic0 vSwitch0 "Service Console"

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-standby vmnic2 vSwitch0 "Service Console"

echo "Setting VMotion portgroup standby/active"

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-active vmnic2 vSwitch0 VMotion

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-standby vmnic0 vSwitch0 VMotion

vmware-vim-cmd internalsvc/refresh_network

0 Kudos
vmpert
Contributor
Contributor
Jump to solution

Thx a lot - this did the "trick".....

0 Kudos