Bug 1497954

Summary: ssh to VM impossible and missing network config in VM when cloud-init 0.7.9-9 is given static ipv6 network config
Product: Red Hat Enterprise Linux 7 Reporter: eraviv
Component: cloud-initAssignee: Ryan McCabe <rmccabe>
Status: CLOSED ERRATA QA Contact: Vladimir <vshypygu>
Severity: high Docs Contact:
Priority: medium    
Version: 7.4CC: huzhao, ipinto, jbadiapa, jgreguske, lars, mmagr, mrunge, vhutsky, vshypygu
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: cloud-init-0.7.9-11.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 14:05:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1330217    
Attachments:
Description Flags
all inputs to cloud-init; ifcfg; cloud-init logs none

Description eraviv 2017-10-03 08:29:51 UTC
Created attachment 1333559 [details]
all inputs to cloud-init; ifcfg; cloud-init logs

Description of problem:
when cloud-init is handed a network_data.json containing an ipv6 static configuration:
1. it fails to create the expected ifcfg-XX file
2. the VM which it instantiated is not accessible via ssh: a login attempt with the configured user (which appears in the user_data file handed to cloud-init) returns 'permission denied'

Version-Release number of selected component (if applicable):
cloud-init-0.7.9-9.el7.centos.2.x86_64
centos 7.2.1511 (Core)

How reproducible:
100%

Steps to Reproduce:
1. Create Ovirt setup with engine, and a host
2. Create a VM instance from a CentOS 7.2.1511 template (CentOS 7 Generic Cloud Image v1608 for x86_64 (2162b33))
3. Instantiate the VM with cloud-init and only set user and password
4. verify that the VM starts and is accessible with set creds
5. stop the VM
6. from engine - run the VM once with same creds, and add network on eth0
7. insert IPv4 and IPv6 details for eth0
8. submit to start the VM
9. open the spice console from engine and login with above creds to get the ip of the VM. 
10. try to connect to the VM with ssh from a regular terminal --> permission denied
10. check /etc/sysconfig/network-scripts/ifcfg-eth0 --> it is not as expected


Actual results:
1. permission denied on ssh access
2. ipv4 + ipv6 static config is missing. ifcfg-eth0 is:

# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=dhcp
DEVICE=eth0
HWADDR=00:1a:4a:16:01:00
ONBOOT=yes
TYPE=Ethernet
USERCTL=no


Expected results:
1. VM accessible via ssh
2. ipv4 + ipv6 static config in ifcfg-eth0


Additional info:
* following configurations to cloud-init work as expected:
 1. ipv4 static
 2. ipv4 dhcp
 3. ipv4 dhcp + ipv6 dhcp
* I set cloud-init services to provide debug info - see logs in attached

Comment 2 Vratislav Hutsky 2017-10-31 13:53:51 UTC
I'm providing qa_ack based on communication that took place in an email thread. The subject matter expert team, RHEVM QE in this case, will verify this particular bugzilla.

My team will do verification and regression testing in EC2, and will ask other stakeholders who make use of cloud-init in their projects to do verification on their side, too.

Comment 4 Vladimir 2017-12-20 10:39:53 UTC
Verified on RHEV 4.2.0.2-0.1.el7
cloud-init version cloud-init-0.7.9-20.el7.x86_64

Comment 5 Israel Pinto 2017-12-20 11:32:48 UTC
(In reply to Vladimir from comment #4)
> Verified on RHEV 4.2.0.2-0.1.el7
> cloud-init version cloud-init-0.7.9-20.el7.x86_64

moving to verify

Comment 8 errata-xmlrpc 2018-04-10 14:05:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:0806