GithubHelp home page GithubHelp logo

Comments (2)

tenthirtyam avatar tenthirtyam commented on August 27, 2024

There's not a native method in the Packer Builder for VMware vSphere to use static IP address assignment. Although this has been mentions / requested in #37.

Options to enable this include:

Ubuntu 18.04

Update the ks.cfg preseed file.

# Networking
d-i netcfg/disable_autoconfig boolean true

# IPv4 Setup
d-i netcfg/get_ipaddress string <static_ipv4_address>
d-i netcfg/get_netmask string <static_ipv4_netmask>
d-i netcfg/get_gateway string <static_ipv4_gateways>
d-i netcfg/get_nameservers string <static_ipv4_dnsservers>
d-i netcfg/confirm_static boolean true

Ubuntu 20.04 and later

Update the user-data used by cloud-init.

  network:
    network:
      version: 2
      ethernets:
        ens33:
         addresses: <static_ipv4_address_cidr>
         gateway4: <static_ipv4_gateway>
         nameservers:
           addresses: [<static_ipv4_dnsservers>]

Windows Server

Update the Autounattend.xml with Ipv4Settings.

<component name="Microsoft-Windows-TCPIP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <Interfaces>
            <Interface wcm:action="add">
               <Ipv4Settings>
                  <DhcpEnabled>false</DhcpEnabled>
               </Ipv4Settings>
               <Ipv6Settings>
                  <DhcpEnabled>false</DhcpEnabled>
               </Ipv6Settings>
               <Identifier>Ethernet0</Identifier>
               <UnicastIpAddresses>
                  <IpAddress wcm:action="add" wcm:keyValue="1"><!--REPLACE WITH IPCIDR--></IpAddress>
               </UnicastIpAddresses>
               <Routes>
                  <Route wcm:action="add">
                     <Identifier>1</Identifier>
                     <Prefix>0.0.0.0/0</Prefix>
                     <NextHopAddress><!--REPLACE WITH GATEWAY--></NextHopAddress>
                  </Route>
               </Routes>
            </Interface>
         </Interfaces>
      </component>
</component>

Thanks,
Ryan

from packer-examples-for-vsphere.

tenthirtyam avatar tenthirtyam commented on August 27, 2024

This can be addressed by modifying the config files per #17 (comment).

from packer-examples-for-vsphere.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.