Discussion:
[libvirt-users] How to assign IP via virt-install
Devis Reagan Ponraj -ERS, HCL Tech
2018-09-17 08:29:53 UTC
Permalink
Hi Team ,

I am new to virt-install , need your help pls .

With below command I able to create a VM & I can see the mac address as well .

virt-install --virt-type=kvm --name newclicentos --ram 6144 --vcpus=2 --import --network=bridge=br0,model=virtio --graphics vnc --disk path=centos7.0.qcow2,size=60,bus=virtio,format=qcow2 --os-variant centos7.0 --mac=00:00:00:00:01:01


With below command I am trying to assign an IP address , however it throws error .
I dont want to give --location as I already have the vm build in centos7.0.qcow2
Is there a was I can assign static IP to my VM ?

[***@localhost tmp]# virt-install --virt-type=kvm --name newclicentos --ram 6144 --vcpus=2 --import --network=bridge=br0,model=virtio --extra-args "ip=10.254.173.99::10.254.172.1::255.255.254.0::newclicentos:eth0:none" --mac=00:00:00:00:01:01 --graphics vnc --disk path=centos7.0.qcow2,size=60,bus=virtio,format=qcow2
ERROR --extra-args only work if specified with --location.


Let me know if you need any info from me

Thanks,
Devis Reagan



Regards,
Devis Reagan
HCL Technologies Ltd.
www.hcl.com<http://www.hcl.com/>
::DISCLAIMER::
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Peter Crowther
2018-09-17 12:26:21 UTC
Permalink
You've not given libvirt anything to install; therefore, it has nothing it
can tell about the IP address. Are you intending, for example, to add a
mapping between MAC and IP address to a DHCP server for later use?

- Peter

On Mon, 17 Sep 2018 at 13:23, Devis Reagan Ponraj -ERS, HCL Tech <
devisreagan-***@hcl.com> wrote:

> Hi Team ,
>
> I am new to virt-install , need your help pls .
>
> With below command I able to create a VM & I can see the mac address as
> well .
>
> virt-install --virt-type=kvm --name newclicentos --ram 6144 --vcpus=2
> --import --network=bridge=br0,model=virtio --graphics vnc --disk
> path=centos7.0.qcow2,size=60,bus=virtio,format=qcow2 --os-variant centos7.0
> --mac=00:00:00:00:01:01
>
>
> With below command I am trying to assign an IP address , however it
> throws error .
> I dont want to give --location as I already have the vm build in
> centos7.0.qcow2
> Is there a was I can assign static IP to my VM ?
>
> [***@localhost tmp]# virt-install --virt-type=kvm --name newclicentos
> --ram 6144 --vcpus=2 --import --network=bridge=br0,model=virtio
> --extra-args "ip=10.254.173.99::10.254.172.1::255.255.254.0::newclicentos:eth0:none"
> --mac=00:00:00:00:01:01 --graphics vnc --disk
> path=centos7.0.qcow2,size=60,bus=virtio,format=qcow2
> ERROR --extra-args only work if specified with --location.
>
>
> Let me know if you need any info from me
>
> Thanks,
> Devis Reagan
>
>
>
>
> Regards,
>
> Devis Reagan
>
> *HCL Technologies Ltd.*
>
> *www.hcl.com <http://www.hcl.com/>*
> ::DISCLAIMER::
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> The contents of this e-mail and any attachment(s) are confidential and
> intended for the named recipient(s) only. E-mail transmission is not
> guaranteed to be secure or error-free as information could be intercepted,
> corrupted, lost, destroyed, arrive late or incomplete, or may contain
> viruses in transmission. The e mail and its contents (with or without
> referred errors) shall therefore not attach any liability on the originator
> or HCL or its affiliates. Views or opinions, if any, presented in this
> email are solely those of the author and may not necessarily reflect the
> views or opinions of HCL or its affiliates. Any form of reproduction,
> dissemination, copying, disclosure, modification, distribution and / or
> publication of this message without the prior written consent of authorized
> representative of HCL is strictly prohibited. If you have received this
> email in error please delete it and notify the sender immediately. Before
> opening any email and/or attachments, please check them for viruses and
> other defects.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> _______________________________________________
> libvirt-users mailing list
> libvirt-***@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users
Devis Reagan Ponraj -ERS, HCL Tech
2018-09-17 16:30:53 UTC
Permalink
Hi Peter ,

I’m using centos7.0.qcow2 which is a centos already and hence not given any OS/IOS .

My intention is to assign a static Mac and IP address that I wish to , which I will use later for easy use (no dhcp in this scenario , Infact I was able to get ip from dhcp with no problem)


Regards,
Devis Reagan
HCL Technologies Ltd.
www.hcl.com
________________________________
From: Peter Crowther <***@melandra.com>
Sent: Monday, September 17, 2018 5:56:21 PM
To: Devis Reagan Ponraj -ERS, HCL Tech
Cc: libvirt-***@redhat.com
Subject: Re: [libvirt-users] How to assign IP via virt-install

You've not given libvirt anything to install; therefore, it has nothing it can tell about the IP address. Are you intending, for example, to add a mapping between MAC and IP address to a DHCP server for later use?

- Peter

On Mon, 17 Sep 2018 at 13:23, Devis Reagan Ponraj -ERS, HCL Tech <devisreagan-***@hcl.com<mailto:devisreagan-***@hcl.com>> wrote:

Hi Team ,

I am new to virt-install , need your help pls .

With below command I able to create a VM & I can see the mac address as well .

virt-install --virt-type=kvm --name newclicentos --ram 6144 --vcpus=2 --import --network=bridge=br0,model=virtio --graphics vnc --disk path=centos7.0.qcow2,size=60,bus=virtio,format=qcow2 --os-variant centos7.0 --mac=00:00:00:00:01:01


With below command I am trying to assign an IP address , however it throws error .
I dont want to give --location as I already have the vm build in centos7.0.qcow2
Is there a was I can assign static IP to my VM ?

[***@localhost tmp]# virt-install --virt-type=kvm --name newclicentos --ram 6144 --vcpus=2 --import --network=bridge=br0,model=virtio --extra-args "ip=10.254.173.99::10.254.172.1::255.255.254.0::newclicentos:eth0:none" --mac=00:00:00:00:01:01 --graphics vnc --disk path=centos7.0.qcow2,size=60,bus=virtio,format=qcow2
ERROR --extra-args only work if specified with --location.


Let me know if you need any info from me

Thanks,
Devis Reagan





Regards,

Devis Reagan

HCL Technologies Ltd.

www.hcl.com<https://apac01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.hcl.com%2F&data=02%7C01%7Cdevisreagan-p%40hcl.com%7Cdf571db5311d4204c4fd08d61c98c9aa%7C189de737c93a4f5a8b686f4ca9941912%7C0%7C0%7C636727839890362045&sdata=78LzZ%2BUGa56qOIUdPY77P%2FiY01Fu%2FdGd9vjbkJaS%2Bto%3D&reserved=0>

::DISCLAIMER::
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Loading...