[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 506
  • Last Modified:

best way of setting up ip addresses with a script like netsh -f for instance

I am working on a 2008 r2 vmware server build project and wanted to know if there is a way to script the ip setting including dns primary and secondary additional dns ip addresses , nic  hostname additional nic if required

been googleing netsh but not found much I am sure somebody on ee has already done this
I am doing this to avoid finger problem inputting wrong dns etc by embeddiong them in the script so only the last octet is changed by having the first three octets in the script

it for vsphere 4.1 by the way  
0
IanTh
Asked:
IanTh
  • 6
  • 6
1 Solution
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Do you not have access to vCenter to deploy templates, as part of the Customization Specifications?
0
 
IanThAuthor Commented:
yes I am using templates I have set dns and some other stuff in the template but I was thinking of scripting it as I have worked on numerous projects like this and this one is going to use multiple nics on the server and use the first three octets and just get the build engineer to put in the 4th octet from their build sheet and embed all the dns gateway subnet

as using a vmware template i can not insert the three first octets and leave the forth  thats why I think scripting would be better

 
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Ok! It you want to make it idiot proof for your "Engineers".

Personally, we prefer the "hands-on" approach, and give the Engineers back a "little bit of skill", otherwise they get bored, and QA then suffers!
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
IanThAuthor Commented:
it will have to be mind you I have found a vb function for setting ip addresses so I have embeded dns settings and additional dns ip addresses so all I need is a set ip address so tonight I am going to do a vb app hopefully for setting ip address, subnet mask and gateway
0
 
IanThAuthor Commented:
still testing
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
you can set the IP address via vCLI
0
 
IanThAuthor Commented:
vcli ?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Powershell, VMware Powershell
0
 
IanThAuthor Commented:
never heard of vcli just powercli

never used it before got a good link for doing that ?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Get-VM VMName | Get-VMGuestNetworkInterface -GuestUser Administrator -GuestPassword <password> -HostUser root -HostPassword <password> | Set-VMGuestNetworkInterface -IPPolicy Static -Ip <IPAddress> -Netmask 255.255.252.0 -Gateway <Gateway> -GuestUser Administrator -GuestPassword <password> -HostUser root -HostPassword <password>

Open in new window

0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
the above, will set an IP address in a VM using PowerCLI, here is the syntax for

Set-VMGuestNetworkInterface

http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/Set-VMGuestNetworkInterface.html
0
 
IanThAuthor Commented:
it didn't actually work as #i planned on my next similar project I will use the vcli method you told me about

thanks
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now