VMware Cloud Community
baksm
Contributor
Contributor

KickStart - Vmotion

I use kickstart to deploy my ESX servers (ESX 3.5 Update 2). I've try to used

  1. Enable vmotion

vimsh -n -e "hostsvc/vmotion/vnic_set vmk0"

it will not put the check mark for VMotion - Enabled in the Vmkernel but when I run the same command from the console it does check the box for VMotion Enabled.

Is there other way to turn VMotion on during the scripted install?

Reply
0 Kudos
16 Replies
weinstein5
Immortal
Immortal

I believe the issue is since vMotion is a virtual center feature you can only enable from the vi client connected to virtual center -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
baksm
Contributor
Contributor

When I use Putty to log in to ESX Host and run the same command from there it does work. Why it doesn't work when it's in the kickstart script?

Reply
0 Kudos
sbeaver
Leadership
Leadership

When during the build process are you trying to enable vmotion?

Steve Beaver

VMware Communities User Moderator

====

Co-Author of "VMware ESX Essentials in the Virtual Data Center"

Coming soon to a store near you!

*Virtualization is a journey, not a project.*

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
baksm
Contributor
Contributor

I the %post section:

%vmlicense_text

%packages

@base

%post

cat > /etc/rc.d/rc3.d/S11servercfg << EOF

  1. add nic on vSwitch0

  2. Create vSwitch1 with VMkernel and add vmnic2 and vmnic3

  3. Create vswitch2 portgroup

  1. Active and standby setup and set maxActive for vswitch0 and vswitch1

  2. Refresh the network settings with vimsh

  1. Enable vmotion

vimsh -n -e "hostsvc/vmotion/vnic_set vmk0"

/etc/init.d/mgmt-vmware restart

  1. Rename the file after first execution. Since file name isn't Cap S, it's ignored in subsequent boots

mv /etc/rc.d/rc3.d/S11servercfg /etc/rc.d/rc3.d/s11servercfg

EOF

chmod +x /etc/rc.d/rc3.d/S11servercfg

Reply
0 Kudos
sbeaver
Leadership
Leadership

I have to ask. What editor did you use to create the ks.cfg?

Steve Beaver

VMware Communities User Moderator

====

Co-Author of "VMware ESX Essentials in the Virtual Data Center"

Coming soon to a store near you!

*Virtualization is a journey, not a project.*

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
baksm
Contributor
Contributor

I used "win32pad".

Reply
0 Kudos
stvkpln
Virtuoso
Virtuoso

I've re-written all of my 3.5 kickstarts and replaced vimsh -n -e "<insert here>" with vmware-vim-cmd <insert here sans quotes>. It seems to work a bit cleaner. To answer your question, here's what I use to enable vmotion during my scripted install.. It's worked every time, as far as I know: vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0 (same thing). The big thing I've discovered with doing scripted installs is that before I start issuing vimsh commands during the post install section, I set a sleep 60 setting in to make sure hostd/authd are fully started. Have you verified that the command is actually issuing properly during the post section? You can hit ALT+F1 after the first boot finishes and watch it do it's thing. It should be obvious if the command isn't being issued. It's definitely something you'd notice if you're using vmware-vim-cmd Smiley Happy

-Steve
Reply
0 Kudos
Ales
Contributor
Contributor

I've written kickstart to deploy my ESX servers (ESX 3.5 Update 2).

I use command vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0 and I get error 'Failed to connect: 514 Error connecting to hostd-vmdb service instance.'

thanks for any help.

Reply
0 Kudos
admin
Immortal
Immortal

Try;

esxcfg-vswitch -A VMotion vSwitch0

esxcfg-vmknic -a VMotion -i 192.168.0.1 -n 255.255.255.0

esxcfg-route 192.168.0.254

vimsh -n -e "/internalsvc/refresh_network"

service mgmt-vmware restart

sleep 40

vimsh -n -e "hostsvc/vmotion/vnic_set vmk0"

it may work without;

service mgmt-vmware restart

sleep 40

Reply
0 Kudos
Ales
Contributor
Contributor

I use command 'vmware-vim-vmd internalsvc/refresh_network' in kickstart

After execute this command appear error 'Failed to connect: 514 Error connecting to hostd-vmdb service instance.'

Reply
0 Kudos
sbeaver
Leadership
Leadership

Unless this is after the first boot that command will not work because the vmkernel is not loaded untill then

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
lamw
Community Manager
Community Manager

Actually I'm seeing this issue as well, I'm doing some development work for ESX 3.5u2, and from my past builds for ESX 3.0.2, 3.5 and 3.5u1 enabling VMotion using vimsh call with " hostsvc/vmotion/vnic_set vmk0" has always work and I actually figure out which is the actual VMkernel by doing "esxcfg-vmknic -l" and greping out the correct "vnic" value.

I know this work for past builds, but with ESX 3.5u2, I'm seeing that it won't hold the modifications after attach to VC. Per my kickstart, I have a script that will pull from an external file while it has it's DHCP address from the intial kickstart and figure out what it's final Service Console IP/VMkernel IP,vSwitch Configs, etc ... this becomes a new startup script which executes right before S10network, that works great and also during the kickstart %post% section, I create a reboot script because I also update configurations such as new Service Console memory, but during this "reboot" script, I also create another startup scritp that enables VMotion on the 2nd reboot of the build. When the system finally reboots, it does execute the command to enable VMotion, but what we've found is after attaching to VC, the VMotion gets disable on the VMkernel.

In my past builds prior to 3.5u2, I've been able to enable VMotion prior to attaching to VC without any issues. I don't know if this is an issue or if anyone else has seen this?

Reply
0 Kudos
admin
Immortal
Immortal

What I posted is what I am using for ESX 3.5 Update 2 and works great for me, so at the moment I am not no bothered about changing the syntax, as if it aint broke dont fix it. Smiley Wink doing this with a USB 2GB key ESX Host build, UDA and floppy build method and all work.

Reply
0 Kudos
lamw
Community Manager
Community Manager

Well "vimsh" is the 3.0.2 command, as of 3.5 you get "vmware-vim-cmd" which also includes "vimsh" for those that have older scripts. "vmware-vim-cmd" has more functionality and it allows you to make the call on the console without having to pass in "-n -e" flags to see what's available. Again I've done this builds for previous released but recently on 3.5u2 on a different use case. I've tried both vimsh/vmware-vim-cmd, neither will fully enable VMotion, it's disabled after attaching to VC.

Reply
0 Kudos
admin
Immortal
Immortal

the information you provide is invaluable to all and thanks, but the old syntax works for me fine, weird why it is failing for you.

Reply
0 Kudos
lamw
Community Manager
Community Manager

Yea for this client, they would like all this to be a one step click, pretty much boot the server on their build network and after the system boots up, everything is fully configured and I'm not using ks.cfg to manually specific static IP or anything, I'm pull that from an external file and part of that configuration is to enable VMotion on the VMkernel. I've done this where some scripts are kicked off after the initial build is completed through set of scripts, but never a one pass type of deal.

I'm going to see if my other method works by just modifying the "/etc/vmware/hostd/hostsvc.xml" with the VMkernel that needs to be enable through some script logic and also updated /etc/vmware/esx.conf and regnerating the md5 checksum file to ensure that it'll keep the updates. I'll update if that works, if not I think they're okay with just enabling VMotion by hand since they still need to go into the VI Client for a few changes.

I know both vimsh and vmware-vim-cmd works, good to hear it works for you.

Reply
0 Kudos